You are not logged in.

#1 2016-06-24 08:24:19

gonny95
Member
From: South Korea
Registered: 2015-03-31
Posts: 14
Website

[SOLVED] kvm qemu no networking

Hi I always have used virtualbox but now I'm trying to use kvm and qemu instead.
I followed instructions from https://wiki.archlinux.org/index.php/KVM and successfully installed winXP.
But when I run winXP using this command, there's no ethernet connection:

qemu-system-x86_64 -enable-kvm -cpu host -drive file=XP.img,format=raw

This is my ethernet device:

        enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.2  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::9306:e683:97ba:722  prefixlen 64  scopeid 0x20<link>
        ether d0:50:99:85:18:8c  txqueuelen 1000  (Ethernet)
        RX packets 121911  bytes 151107339 (144.1 MiB)
        RX errors 0  dropped 2259  overruns 0  frame 0
        TX packets 71137  bytes 8314858 (7.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xdf000000-df020000  

What should I do to solve this?

Last edited by gonny95 (2016-06-24 14:50:42)

Offline

#2 2016-06-24 12:34:04

wtx
Member
Registered: 2014-06-09
Posts: 76

Re: [SOLVED] kvm qemu no networking

I think that you need to use "-net" qemu option. For example like this:

-net nic,model=ne2k_pci,vlan=0   -net tap,script=./qemu-ifup.sh

Offline

#3 2016-06-24 14:50:05

gonny95
Member
From: South Korea
Registered: 2015-03-31
Posts: 14
Website

Re: [SOLVED] kvm qemu no networking

I tried but that didn't work too.
But I found a working solution.

qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -m 4G -drive file=XP.img,format=raw -net nic,model=pcnet -net user

According to https://en.wikibooks.org/wiki/QEMU/Devices/Network
I should've used model=e1000 because I'm using intel gigabit ethernet but only model=pcnet works. that's weird.

Last edited by gonny95 (2016-06-24 15:07:44)

Offline

#4 2016-06-24 15:08:26

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] kvm qemu no networking

gonny95 wrote:

I should've used model=e1000 because I'm using intel gigabit ethernet but only model=pcnet works. that's weird.

It doesn't matter what NIC you have on your host as the guest VM has no knowledge of it. I would presume that Windows only has inbuilt drivers for the pcnet adapter, you should be able to use e1000 instead but you'll have to install the Windows drivers for it.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2016-06-24 15:14:15

gonny95
Member
From: South Korea
Registered: 2015-03-31
Posts: 14
Website

Re: [SOLVED] kvm qemu no networking

slithery wrote:
gonny95 wrote:

I should've used model=e1000 because I'm using intel gigabit ethernet but only model=pcnet works. that's weird.

It doesn't matter what NIC you have on your host as the guest VM has no knowledge of it. I would presume that Windows only has inbuilt drivers for the pcnet adapter, you should be able to use e1000 instead but you'll have to install the Windows drivers for it.

Oh thanks for the information!

Offline

Board footer

Powered by FluxBB