0
votes

I'm trying to forward incoming TCP connections to one port on the host to one port on VM Guest but I get an error

host1:~# qemu-kvm -net user,hostfwd=tcp::8300-192.168.0.2:830

vlan 0 with no nics Unable to init server: Could not connect: Connection refused

(qemu-system-x86_64:16665): Gtk-WARNING **: cannot open display:Warning:

I'm following the opensuse-kvm documentation. Can I run this command when the guest vm is running or do I need to run the command to start the vm?

Thanks a lot in advance

Regards

1
In case of I must start the guest vm with that parameter, how can I add this one in the xml definition?Javi

1 Answers

0
votes

It looks like you have two problems here:

(1) "vlan 0 with no nics" -- this means you've created a network (with -net) but haven't plugged any emulated network cards into it. QEMU's networking configuration is in two parts: the backend where you say how the network should work, and the frontend where you create network cards and plug them into that network. The default command line arguments will do both for you, but if you specify any networking options the defaults don't kick in, and so you need to specify both parts yourself. That means you need either (a) new style command lines with -netdev for the network and -device for the nic (b) old style legacy command lines with -net user/tap/etc for the network and -net nic for the nic

Check the documentation for details: http://wiki.qemu.org/Documentation/Networking

(2) Your other problem is that it looks like you don't have a working X display, which means that QEMU is failing to create the graphics window. This is the actually fatal error -- messing up your network config will just create a guest which isn't connected to the net.

Also, your error message seems a bit scrambled: the "Warning: " part of the message goes in front of the "vlan 0 with no nics" part. Cut and paste mixup?