Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to export some services from the guest os to the host os, via kvm, and by the same way learn some things about networking. I have tried the following commands:

In the host (kubuntu 10.4):

$ sudo tunctl -u ascobol
Set 'tap0' persistent and owned by uid 2401
$ sudo ifconfig tap0 192.168.2.1 netmask 255.255.255.0 broadcast 192.168.2.255

The ifconfig command returns:

$ /sbin/ifconfig
tap0      Link encap:Ethernet  HWaddr 3e:4e:e3:cc:bc:92  
inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
      inet6 addr: fe80::3c4e:e3ff:fecc:bc92/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:17 overruns:0 carrier:0
      collisions:0 txqueuelen:500 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 tap0

Then I run the virtual machine (ubuntu server 10.4):

$ sudo  kvm -hda ubuntuserver104.qcow2 -net nic -net tap,name=tap0,script=no

(I'm using sudo because without it fails with the following message:)

warning: could not configure /dev/net/tun: no virtual network emulation

With sudo the virtual machine boots, I just get this message:

pci_add_option_rom: failed to find romfile "pxe-rtl8139.bin"

In the virtual machine:

$ ifconfig eth0 192.168.2.2 netmask 255.255.255.0 broadcast 192.168.2.255

Now if I run:

$ ssh 192.168.2.2

I just get a

No route to host

What is wrong with this setup ? Thanks !

share|improve this question

2 Answers 2

up vote 0 down vote accepted

The problem when the virtual machine was launched:

$ sudo  kvm -hda ubuntuserver104.qcow2 -net nic -net tap,name=tap0,script=no

I replaced

name=tap0

by

ifname=tap0

and it worked

share|improve this answer
pci_add_option_rom: failed to find romfile "pxe-rtl8139.bin"

means you have no pxe bootrom images installed. try installing them, or look them up in /usr/share/qemu or /usr/share/gpxe

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.