About network bridge.
Hello everyone,
Thanks for reading my email. I got a question about the network bridge in qemu-kvm.
When I start my vm using virsh start vm2 or virt-manager, the vm's network is working. I can access the internet within the vm.
However, we I start the same vm using qemu-system-x86_64 vm2.img -m 1024. The vm can run but without internet access. I do not know the reason, can someone give me a direction?
The procedure to set up the system.
1. install the host os, set up bridge networking.
2. use virt-manager create guest vm, choose bridge network in the creation option of virt-manager.
3. run the guest vm.
My system configuration is as follows:
1. Host OS, Ubuntu 12.10 server with a kubuntu-desktop.
2. QEMU-KVM version is 1.2.0.
3. Host network configuration is bridge type, as follows:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto em1
iface em1 inet manual
auto br0
iface br0 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 129.93.6.189
bridge_ports em1
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off4. Guest OS ubuntu-server 12.10. network configuration is as follows:
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.12
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 129.93.6.189Thanks!
Best,
Yaodong
----------------------------------------------
Yaodong Yang
Ph.D. Student
Department of Computer Science & Engineering University of Nebraska-Lincoln
Email: [email protected] OR [email protected]
Quoted 2 lines · Yaodong Yang
When I start my vm using virsh start vm2 or virt-manager, the vm's network is working. I can access the internet within the vm.
However, we I start the same vm using qemu-system-x86_64 vm2.img -m 1024. The vm can run but without internet access. I do not know the reason, can someone give me a direction?
libvirt (virsh and virt-manager) configures networking for you.
When you run QEMU manually you need to do things yourself. If you are running x86 guests on x86 hosts, you should probably use virsh or virt-manager instead of manually running QEMU. It will save a lot of time.
If you need to test custom QEMU binaries, you can simply edit the <emulator> domain XML tag using virsh edit.
If you really want to manually run QEMU then please read the man page. Also see http://qemu-project.org/Documentation/Networking and then do a web search. There are plenty of guides to setting up networking with QEMU.
Stefan