LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   qemu - guest network howto (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/qemu-guest-network-howto-888640/)

lupe 06-27-2011 04:38 PM

qemu - guest network howto
 
Hi,

I've setup up a qemu Linux virtual system and start it with
$ qemu -enable-kvm -m 500 -hda disk.qcow2 -net nic

Problem is that I don't have network access in the virtual system.

In the host (Slackware Linux) I use to have two network configurations depending on where I am:
1. eth0: for localnet and Internet

2. eth0: for intranet <-- don't need it for virtual system
ppp (wvdial for usb 3G) for Internet

How can I have Internet access in situations 1 and 2 in the virtual system and continue to have it also in host system?

jefro 06-27-2011 07:40 PM

I never use the net nic without some advanced options. See this for some advanced info.
http://people.gnome.org/~markmc/qemu-networking.html
http://wiki.qemu.org/Documentation/Networking
http://www.h7.dion.ne.jp/~qemu-win/HowToNetwork-en.html
and many more.

Where you need to state is at the client. If you delete the net nic you get the common NAT configuration for qemu.
Qemu has a virtual router software running. When you boot the client, you set it for dhcp and you should get an ip if you have nic support. (may need to set a new nic card or add in default nic driver)

Then I just add in my dns entry or in most cases it simply works. Your host works by it's choice of gateway or by availability.

Remove the net nic and then see ifconfig in client.


All times are GMT -5. The time now is 03:37 PM.