# [SOLVED] NIC gone between VirtualBox 3.0.10r5497 and 3.1.4?

## eohrnberger

I'm not sure if this is the right forum, so please forgive me, or point me to where I should post it.

I have a VM guest created from the Gentoo Live DVD x86-AMD64 32ul-10.1 boot CD running under VirtualBox 3.0.10r5497. I configured the network interface as Intel PRO/1000 MT Desktop (82540OEM) bridged to the host system's network card. This finds the VM's NIC, sets the IP address correctly and can communicate on the LAN.

I copied the VDI to another PC running VirtualBox 3.1.4r57640, and configured the VM exactly the same. Yet when this instance of the VM boots, the Gentoo guest does not find the NIC. It doesn't matter if it is configured as bridged, NAT or whatever. I tried to changing the VM config to use PCnet-PCI II (Am79C970A), configured and built the kernel to create pcnet32 module. I modprobed the module into the kernel, autoloaded it into the kernel, but it doesn't find the VM's NIC either and can't get eth0 up. lspci shows the hardware, but the driver module can't seem to find it.

I've moved Windows guest VDIs from one PC to the other, and their network connections all work.

Thinking it may be related to the VirtualBox versions, I installed 3.0.10r5497 on the second machine, but that made no difference. It's now back up to 3.1.4r57640, but I'm no further in figuring this out.

What am I doing wrong? This has got me baffled.

Thanks in advance.Last edited by eohrnberger on Tue Mar 09, 2010 7:23 pm; edited 1 time in total

----------

## gentoo_ram

I'm guessing the virtual MAC address changed and the interface is no longer eth0.  Delete the file /etc/udev/rules.d/70-persistent-net.rules on the guest and reboot.  You can do 'ifconfig -a' to see which interface the guest is seeing now.

----------

## eohrnberger

Yup.  That fixed it.  

Thanks very much for the help.  I appreciate it.  Going to add this to my Gentoo notes.

----------

## lyallp

Pre 3.1 VirtualBox Guest of Gentoo, upgraded to 3.1.+ and networking stopped.

Yep, fixed it for me too!

----------

## eohrnberger

Isn't it great when you get outstanding technical support?

Now, if only I can figure out how to make a Windows XP system service from a VM, and I'd be all set.

(Yes, I know that there is a collection of scripts around that should do it, but I'm thinking that it needs to be in VirtualBox itself - unless you have another pointer / hint?)

----------

## lyallp

Setting up headless operation of VirtualBox using 'VBoxHeadless --startvm vmnameid' 

Placing appropriate start/stop command in /etc/conf.d/local.start and /etc/conf.d/local.stop 

Adding local to your default startup using 'rc-update add local default'

Not something like that?

----------

## eohrnberger

Why yes.  That would work perfectly on a Linux machine.  I need to do the functional equivalent on a Windows machine.

----------

## lyallp

Scheduled Tasks, run a batch file which is scheduled at system boot, which contains the previously mentioned commands.

This won't help you when you shutdown your windows host, you would need to manage the shutdown such that the Guest is 'saved', to prevent corruption.

Not being a huge expert at Windows, is there a 'run at shutdown' command?

----------

## eohrnberger

 *lyallp wrote:*   

> a 'run at shutdown' command?

 

No, I'm aware of no such command for Windows.  

Ideally, a Windows service would start the VM on boot, and shut it down at system shutdown, saving the state of the VM.  Considering that in order to place a VM guest on a Windows host for production, this would kinda be one of those really needed things.

----------

## lyallp

On my linux machine, I have replaced my GUI logout menu option with a script, which shuts down all VM's, saving state.

You can create a batch command which uses 

```
VBoxManage --nologo controlvm {vmID} savestate

shutdown
```

 and just make it part of your shutdown procedures to execute it rather than start->shutdown.

Being a production machine, you do have 'procedures' that your prod support people follow?  :Smile: 

----------

## eohrnberger

Well, actually it's my wife and kids PC, running Windows XP, whose hardware has more capabilities than mine    :Surprised: 

I have a Gentoo VM on there, running as a distcc compile server (and other things) for another Gentoo machine on the network.

I've tried using instsrv and srvany to start the VM, but the user context is run in (inspite of what the control panel settings say), doesn't seem to find the <User Profile>.VirtualBox\Virtualbox.xml file in order to be able to start the VM.  I have to admit that I've been trying use the VBoxHeadless.exe program.Last edited by eohrnberger on Wed Mar 24, 2010 12:33 am; edited 1 time in total

----------

## lyallp

In that case

http://forum.drc.su/run-a-script-or-batch-file-on-shutdown-in-windows-xp-vt4369.html

(found by Googling for 'windows execute batch on shutdown' - Google is Great)

----------

