Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 12-02-2011, 09:00 AM   #1
Registered: Feb 2007
Posts: 35

Rep: Reputation: 8
Setting up networking in qemu (kvm) guest


I have a problem with getting the network connected on a winxp guest. I have a computer with network being assigned by dhcp on eth0. Now, I copied the following script:

# script to bring up the tun device in QEMU in bridged mode
# first parameter is name of tap device (e.g. tap0)
# some constants specific to the local host - change to suit your host
# First take eth0 down, then bring it up with IP 
/sbin/ifdown eth0
/sbin/ifconfig eth0 promisc up
# Bring up the tap device (name specified as first argument, by QEMU)
/usr/sbin/openvpn --mktun --dev $1 --user `id -un` --lladdr 00:02:44:30:17:17
/sbin/ifconfig $1 promisc up
# create the bridge between eth0 and the tap device
/usr/sbin/brctl addbr br0
/usr/sbin/brctl addif br0 eth0
/usr/sbin/brctl addif br0 $1
# only a single bridge so loops are not possible, turn off spanning tree protoco                                             
/usr/sbin/brctl stp br0 off 
# Bring up the bridge with ETH0IP and add the default route 
/sbin/ifconfig br0 $ETH0IP netmask broadcast $BROADCAST
/sbin/route add default gw $GATEWAY
The values for ETH0IP, GATEWAY and BROADCAST are obtained from ifconfig and route -n commands. I start the VM guest with the following command:

kvm -m 700 -boot c -hda /media/disk/winxp.qcow -net nic -net tap,ifname=tap0,script=no
As you can see, I assign the same mac address to the guest as it is on the host (that is, because my ISP delivers the connection upon the correct mac address).
Nevertheless, the guest doesn't make a connection. I am stucked on the windows activation screen, which tries to automatically establish a connection. I tried it with the command:

kvm -m 700 -boot c -hda /media/disk/winxp.qcow -net nic,macaddr=00:02:44:30:17:17 -net user
but it does't help. Can anyone give me an advice? I can't configure the connection on the guest, because I can't login before I haven't activated windows.
Old 12-06-2011, 06:31 PM   #2
LQ Newbie
Registered: Aug 2005
Posts: 13

Rep: Reputation: 1
so you have the TAP interface created etc before you try to start windows? Then you are trying to bridge windows to the LAN and have it use the specific mac address so that it gets a DHCP address from your DSL router or something like that? can you past the output of
ifconfig -a
netstat -rn
brctl show


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting break point in guest from qemu using ioctls into kvm Jaskaran Singh Linux - Virtualization and Cloud 2 09-26-2011 07:03 AM
[Debian/Qemu/KVM] Why qemu --enable-kvm works but not kvm directly? gb2312 Linux - Virtualization and Cloud 2 03-21-2011 02:05 PM
[SOLVED] Qemu-kvm file sharing Linux host Xp guest problems Linux.tar.gz Linux - Virtualization and Cloud 6 11-23-2010 05:57 AM
Share between Qemu-Kvm host and guest Alexvader General 1 06-13-2010 03:07 PM
Solaris 10 guest endless reboot under KVM/Qemu green_dood Linux - Software 6 12-13-2009 01:20 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration