qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] Virtual Machine Starts Without Internet Connection


From: Dennis Clarke
Subject: Re: [Qemu-discuss] Virtual Machine Starts Without Internet Connection
Date: Sat, 22 Dec 2018 13:58:51 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Thunderbird/64.0

On 12/22/18 3:23 AM, Jaap Crezee wrote:
Hi,

This works for me:

"-netdev user,id=mynet,hostfwd=tcp::2222-:22,hostfwd=tcp::8888-:80"

That will also"route" port 2222 to the VM port 22 and 8888 to 80.


Thus far I have found that with qemu 2.12.1 that I need to use dhcp to
get an address in the 10.0.2.x/24 netblock or manually set a fixed ip
in that netblock. If I do that then it is possible to ssh "out" from the
guest to the host at 10.0.2.2 and nothing else. DNS doesn't work. There
seems to be no way to ssh into the guest from the host or anywhere else.
At least that is what I have seen thus far. Version 3.1.0 merely SIGSEGV
continuously or throws disaster messages such as "stack smashing
detected" or worse.  It certainly never works.  At least not on Debian
testing x86_64 systems.  FreeBSD 12.x systems build and run qemu 2.12.1
just fine but again 3.1.0 has yet to work, ever, even once.

If there is a way to create a virtual network switch and a manner to get
tcp to flow to the guest from the local guest network then I have yet to
see it.

Reading my way through https://en.wikibooks.org/wiki/QEMU/Networking as
well as https://wiki.qemu.org/Documentation/Networking but almost
everything is limited to x86 type work thus far.

Example ( specify nothing for net ):

qemu-system-x86_64 \
-machine q35 -cpu qemu64 -smp sockets=2 -m 4G \
-drive file=q310_x86_64.img,format=qcow2,id=hd0 \
-boot once=d \
-cdrom /vmware/iso_images/debian-testing-amd64-DVD-1.iso

That boots the Debian testing DVD install image just fine and one may
even do an install but there is no functional network out to the world
during install.  Or afterwards.  Seems to be just some sort of a test
net on 10.0.2.x and only between the guest and the host and *only* in
one direction.  I have tried to ssh to a FreeBSD guest on port 10000 but
nothing happens and not a single packet flows :

$ /usr/bin/qemu-system-riscv64 -nographic -machine virt -smp 2 -m 4G \
-kernel bbl -object rng-random,filename=/dev/urandom,id=rng0 \
-device virtio-rng-device,rng=rng0 \
-drive file=disk.img,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-device virtio-net-device,netdev=usernet \
-netdev user,id=usernet,hostfwd=tcp::10000-:22

However I can ssh out from the guest to the host just fine and the
RISC-V FreeBSD guest seems to be running fine.

Other architectures like ppc64 just fail with odd messages about bus or
device requirements and it isn't clear what is needed :

/usr/bin/qemu-system-ppc64 -machine pseries-2.12 -cpu power9_v2.0 \
-smp sockets=2 -m 8g -drive file=ppc64.img,format=qcow2,id=hd0 \
-object rng-random,filename=/dev/urandom,id=rng0 \
-device virtio-rng-device,rng=rng0 \
-device virtio-net-device,netdev=usernet \
-netdev user,id=usernet,hostfwd=tcp::10000-:22 \
-cdrom /vmware/iso_images/FreeBSD-12.0-RELEASE-powerpc-powerpc64-dvd1.iso
qemu-system-ppc64: -device virtio-rng-device,rng=rng0: No 'virtio-bus' bus found for device 'virtio-rng-device'

One may run "/usr/bin/qemu-system-ppc64 -device help" but that gives
plenty of output with no clear place to use the output.

For example :

Controller/Bridge/Hub devices:
name "dec-21154-p2p-bridge", bus PCI, desc "DEC 21154 PCI-PCI bridge"
name "i82378", bus PCI
name "pci-bridge", bus PCI, desc "Standard PCI Bridge"
name "pci-bridge-seat", bus PCI, desc "Standard PCI Bridge (multiseat)"
name "spapr-pci-host-bridge", bus System
name "usb-host", bus usb-bus
name "usb-hub", bus usb-bus
name "vfio-pci-igd-lpc-bridge", bus PCI, desc "VFIO dummy ISA/LPC bridge for IGD assignment"

Using ANY of those in a -device option merely throws another strange
error. Also, there isn't any documentation in the 3.10 tarball that I
can see.

In any case it seems that there is plenty of reading for me to do.

Dennis



reply via email to

[Prev in Thread] Current Thread [Next in Thread]