Vista on Xen: Using NE2000 in favor to RTL8139

Posted by: admin  :  Category: Xen

I finally took the time getting Vista to work in Xen.

Unfortunately there is a bug which prevents the emulated RTL8139 NIC from working properly in Vista (32-bit version concerned only, 64-bit version worked properly).
This seems a known issue after all and there exist several workarounds on the net concerning this case. So far they basically cover how alternate drivers may be patched together to go along with Vista.

The main reason for this is simple: the RTL8139 runs at 100 mbit/s and is required to get decent speeds.

However there is also the possibility to run the guest domain with NE2000 NIC emulation. Albeit this will only give you a network connection speed of 10 mbit/s full-duplex it is easier to get working right away without fiddling around with INF files and such.

Even though Microsoft dropped NE2000 driver support in Vista the NIC may still be used along with the NE2000 Drivers for Windows 2000.
To enable the use of NE2000 NIC emulation I changed my HVM configuration file accordingly:

vif = [ 'type=ioemu, bridge=xenbr0, model=ne2k_pci0 ]

Since my Vista lacked networking support I placed my driver image into an ISO image and changed the HVM to assign a virtual CD-ROM drive:

disk = [ 'file:/mnt/vm/Xen/Vista/disk1_vol1.img,hda,w',
'file:/mnt/vm/Xen/Vista/drivercd.iso,hdc:cdrom,r' ]

The ISO image was created as follows:

mkisofs -o drivercd.iso -J -r /path/to/w2k_8029.zip

The NE2000 Driver ISO is also available as download from my site.

After starting up Vista skip the ‘Add New Hardware Wizard’ in the first. Instead extract the ZIP file from the (virtual) CD-ROM drive to a temporary location.
Afterwards go to Device Manager and select the (yet) unknown pci device and choose the ‘Update Driver’ option from the Drivers tab.
From there go along with ‘Browse My Computer for Software’ and ‘List of Drivers on My Computer’ and clich the ‘Have Disk’ button.
Open the folder containing the extracted ZIP file’s contents and locate the NETRTP5.INF file. You should be given the choice of the ‘Realtek RTL8029 PCI Ethernet NIC’ which you are to accept.
After completing driver installation you should go device properties’ Extended tab and set ‘Duplex Mode’ to be ‘Full Duplex’ for best performance.

Using NE2000 NIC emulation Windows Vista will get basic network connectivity. It is easy enough to install for everybody and provides modest network speed.
If you need FastEthernet performance there is no way around patching drivers, using Vista64, waiting for an updated official driver or some guru to fix it in Xen itself (even if they didn’t screw it up in the first place…).

[Update 2007/06/30]

Here’s one thing I forget to note when I wrote the article in the first place.

Xen (at least 3.0.3 which I run) seems to have a bug which resets the NIC emulation from NE2000 to RTL8139 upon reset of the HVM.

Because of this I changed my HVM config file to destroy the HVM so I won’t end up with a non-working NIC emulation.

on_reboot = "destroy"
on_crash = "destroy"

6 Responses to “Vista on Xen: Using NE2000 in favor to RTL8139”

  1. thomas boltze Says:

    Hi Gianpaolo,
    This is a nice article. I am trying to get Vista running on CentOS5 with an HVM enabled AMD box and get stuck after the installation and reboot:
    I get through install and can create a user name, then after reboot (I switch it to boot from hdd) Vista starts, but comes with an error message about boot device Not CD, then for a split second it shows a screen with a choice between Vista, NT and DOS and then the screen becomes a colorful mess and the VM destroys itself.

    I tried to find more detailed instructions for getting vista up and running, but have not found any. Can you help ?

    Thanks,
    Thomas

  2. Gianpaolo Del Matto Says:

    @ thomas

    I did install Vista Business multiple times in Xen in both 32-bit and 64-bit HVM emulation without any problems.

    Here’s my config file I use for running Vista:

    [..]
    name = “Vista32”
    builder = “hvm”
    memory = “1024”
    disk = [ ‘file:/mnt/vm/Xen/Vista32/disk1_vol1.img,hda,w’, ]
    vif = [ ‘type=ioemu, mac=00:16:3e:0c:6e:18, bridge=xenbr0, model=ne2k_pci’, ]
    uuid = “7595f0f3-c6bc-9641-8d3e-43129b7405c9”
    device_model = “/usr/lib64/xen/bin/qemu-dm”
    kernel = “/usr/lib/xen/boot/hvmloader”
    vnc=1
    vncunused=1
    apic=1
    acpi=1
    pae=1

    vcpus=2
    serial = “pty” # enable serial console
    on_reboot = ‘destroy’
    on_crash = ‘destroy’
    on_powerof = ‘destroy’
    [..]

    And this one I used for setup:

    [..]
    name = “Vista32”
    builder = “hvm”
    memory = “1024”
    disk = [ ‘file:/mnt/vm/Xen/Vista32/disk1_vol1.img,hda,w’, ‘phy:/dev/hdc,hdc:cdrom,r’, ]
    boot=”d”
    vif = [ ‘type=ioemu, mac=00:16:3e:0c:6e:18, bridge=xenbr0, model=ne2k_pci’, ]
    uuid = “7595f0f3-c6bc-9641-8d3e-43129b7405c9”
    device_model = “/usr/lib64/xen/bin/qemu-dm”
    kernel = “/usr/lib/xen/boot/hvmloader”
    vnc=1
    vncunused=1
    apic=1
    acpi=1
    pae=1

    vcpus=2
    serial = “pty” # enable serial console
    on_reboot = ‘restart’
    on_crash = ‘restart’
    on_powerof = ‘destroy’
    [..]

    The latter one I use during the initial setup and during the first reboot. I changed only boot=”cda” for the first reboot, but still keept the setup cd available.

    From the Vista point of view the setup was done regurlary, e.g. no special switches or workarounds used.

    There’s maybe to things to notice:

    – I used only harddisk images, not real partitions, for HVM emulation with Windows
    – I used only MSDN versions, never OEM versions, for an install

    My further specs are:

    Intel Core 2 Duo 6420, 2 GB RAM, limited Xen Dom0 to 512 MB via kernel args, left rest available to Xen DomU’s.

    Xen Dom0 runs Fedora Core 6 x86_64 with Xen 3.0.3.

    HTH,

    Gianpaolo

  3. chaitanya Says:

    it is good article…but I changed my svm file as u specified. but changing the file when i try to start domain it getting disappear. but xm list showing that dom-U is in runnig state.

  4. Gianpaolo Del Matto Says:

    @ chaitanya

    Well, I don’t know what’s the reason for this.
    Personally I’d say it should work when it shows up in ‘xm list’, but on the other I’m not familiar with either your system and the particular software releases it runs.

    Maybe having a look to the logfiles may help?

    Greetings,
    Gianpaolo

  5. Mohana Says:

    Thank you for telling. I have not in fact have time to learn this yet but I’ve bookmarked it so that I can look over it later.

  6. Gerhold Says:

    This is probably the perfect article that ever cross my reference. I do not see why anyone should disagree. It may be too easy #for them# to comprehend…anyway good work i’m coming back here for More Nice Stuff!!