[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-discuss] Cannot ssh into a VM when using launching qemu with hostf
From: |
Kevin Wilson |
Subject: |
[Qemu-discuss] Cannot ssh into a VM when using launching qemu with hostfwd |
Date: |
Thu, 30 Aug 2018 23:12:59 +0300 |
Hello,
I am using qemu version 2.11.1 on Ubuntu 18.04
I am trying to launch a VM and ssh into it without using tap devices
and iptables.
When I try to use "-redir" I get a message that it is deprecated.
So I tried using the hostfwd option, according to the man page.
This is how I launched qemu:
/usr/bin/qemu-system-x86_64 -name us-vhost-vm1 \
-cpu host -enable-kvm -m 2048 -object
memory-backend-file,id=mem,size=2048M,mem-path=/mnt/huge,share=on
-numa node,memdev=mem -mem-prealloc \
-smp cores=2,sockets=1 -drive file=$vm_img,index=0,media=disk,format=$FORMAT \
-netdev user,id=myid,hostfwd=tcp:10022-:22 -device
rtl8139,netdev=myid,id=net0,mac=00:00:00:00:10:01
The vm_img I am using is an Ubuntu 16.04 qcow2 image.
The VM starts, and when I run ifconfig -a inside it I do eth0, which
is an rtl8139 device (as ethtool -i eth0 shows).
Also on the VM (guest), both the PermitRootLogin without-password
and PermitRootLogin in /etc/ssh/sshd_config were set to yes, and I can
ssh 127.0.0.1 in the guest itself.
But when I try to ssh from the host with "ssh localhost -p 10022", I
cannot connect, it simply hangs endlessly, and does not prompt me
for user.
What can be the reason for that it does not work for me ?
Regards,
Kevin
- [Qemu-discuss] Cannot ssh into a VM when using launching qemu with hostfwd,
Kevin Wilson <=