# VirtualBox 4.0.8 broken since upgrade



## Doug (May 23, 2011)

Hello 
I built a new machine FreeBSD 8.2 and installed Virtualbox 3.1.12 (I think) and added a guest OS. I then upgraded all my ports using portupgrade and Virtualbox (4.0.8).version no longer will start the guest OS. I have tried installing the guest OS but get the same error. Have tried deinstall of Virtualbox and a reinstall but get the same error.


```
Failed to open a session for the virtual machine Windows1.
The virtual machine 'Windows1' has terminated unexpectedly during startup with exit code 1.

Result Code: 
NS_ERROR_FAILURE (0x80004005)
Component: 
Machine
Interface: 
IMachine {662c175e-a69d-40b8-a77a-1d719d0ab062}


RTR3Init failed with rc=-1912 (rc=-1912)
```

Any assistance would be much appreciated.


----------



## tingo (May 23, 2011)

Have you remembered to unload and load again the Virtualbox kernel module (virtualbox-ose-kmod)?


----------



## wblock@ (May 23, 2011)

After rebuilding the kernel modules provided by emulators/virtualbox-ose-kmod, it's necessary to reboot.  Those modules can't be unloaded and reloaded for some reason I either forget or never knew.  If that's the problem, there will be version error message in /var/log/messages.


----------



## _martin (May 23, 2011)

I didn't have to reboot in my case. I'm running VirtualBox on my server and did an upgrade yesterday. I had to stop all virtual machines and did a quick:

`# /usr/local/etc/rc.d/vboxnet stop && /usr/local/etc/rc.d/vboxnet start`

 to unload/load all kernel modules. And actually I was very please to see the rc script to handle headless start/stop in this release (4.x).


----------



## Doug (May 23, 2011)

Thanks for your quick responses. The machine has been rebooted a couple of times and the problem still occurs.


----------



## vermaden (May 23, 2011)

@matoatlantis

How's the performance with 4.x, better or You even did not 'feel' the difference, any neat features to upgrade to 4.x?


----------



## wblock@ (May 23, 2011)

matoatlantis: It's vboxdrv that wants a reboot.  Come to think of it, maybe that's no longer necessary with 4.0.

vermaden: 4.0 seems the same performance-wise.  For me, one really good new feature is scaled mode, so it can finally show a large console while running in a X window.


----------



## _martin (May 23, 2011)

vermaden said:
			
		

> @matoatlantis
> 
> How's the performance with 4.x, better or You even did not 'feel' the difference, any neat features to upgrade to 4.x?



Hm - I didn't do any tests yet so I would have to say I don't 'feel' any difference. I'm running Solaris/FreeBSD/Linux on ZFS raidz and those VMs were able to write >200MB/s before. There were lot of bug fixes and some misc support was added - as mentioned on virtualbox wiki.

Nothing major in my case that I would have to upgrade but 4.x version is out long enough to go with it.

But rc script was a nice bonus to it


----------



## _martin (May 23, 2011)

wblock said:
			
		

> matoatlantis: It's vboxdrv that wants a reboot.  Come to think of it, maybe that's no longer necessary with 4.0.



I made 3 minor upgrades with 3.x version and never saw any problem with stopping/starting VMs - they were never down all at the same time though. Problem occurred with a 3.x to 4.x version upgrade when VM startup was not possible and ended up with NS_ERROR_FAILURE.
syslog showed an issue with:


```
May 22 21:44:50 foxi kernel: SUP_IOCTL_COOKIE: Version mismatch. Requested: 0x180000  Min: 0x180000  Current: 0x140001
May 22 21:55:25 foxi kernel: SUP_IOCTL_COOKIE: Version mismatch. Requested: 0x180000  Min: 0x180000  Current: 0x140001
```
Which suggested an issue with those modules. I had to stop all VMs and do a unload/load (as mentioned above). Everything started up nicely without complaining so I would say it's safe to just unload/load again. 

It's maybe worth mentioning that when I did this with 3.x version (unload) memory leak occured: 


```
May 22 22:24:16 foxi kernel: Warning: memory type iprtheap leaked memory on destroy (12 allocations, 576 bytes leaked).
```


----------



## Doug (May 24, 2011)

Hello
Thanks. In my earlier post I meant I have rebooted the whole FreeBSD host machine a couple of times and the problem persists. I also tried the load and unload but I expect a reboot would have done this anyway.

I do see these messages in the syslog which looks like the problem mentioned in the above post so maybe one of the drivers did not get updated in the upgrade.


```
May 24 09:20:18 Server kernel: SUP_IOCTL_COOKIE: Version mismatch. Requested: 0x180000  Min: 0x180000  Current: 0x140001
May 24 09:20:32 Server kernel: pid 3340 (VirtualBox), uid 1001: exited on signal 6
```
The version is virtual box ose 4.0.8 r71778


```
# kldstat
Id Refs Address    Size     Name
 1   90 0xc0400000 bd97b4   kernel

33    3 0xc11a9000 2ebfc    vboxdrv.ko

38    1 0xc68d7000 9000     i915.ko
39    1 0xc68e1000 14000    drm.ko
41    2 0xc79c9000 5000     vboxnetflt.ko
42    1 0xc6479000 2000     vboxnetadp.ko
```


----------



## wblock@ (May 24, 2011)

Make sure your system source matches the installed system; you've updated with csup but haven't built and installed world/kernel yet, that might be the problem.  Then manually rebuild emulators/virtualbox-ose-kmod:
`# cd /usr/ports/emulators/virtualbox-ose-kmod && make clean deinstall install`

Unload and reload the vboxdrv module, or reboot.


----------



## wblock@ (May 24, 2011)

matoatlantis said:
			
		

> I made 3 minor upgrades with 3.x version and never saw any problem with stopping/starting VMs - they were never down all at the same time though.



It wasn't a problem with starting VMs, it was something like PR 139188.  Maybe I have it backwards and it was the other modules that could not be loaded in /boot/loader.conf.  Maybe it's all fine now.


----------



## vermaden (May 24, 2011)

matoatlantis said:
			
		

> Hm - I didn't do any tests yet so I would have to say I don't 'feel' any difference. I'm running Solaris/FreeBSD/Linux on ZFS raidz and those VMs were able to write >200MB/s before. There were lot of bug fixes and some misc support was added - as mentioned on virtualbox wiki.
> 
> Nothing major in my case that I would have to upgrade but 4.x version is out long enough to go with it.
> 
> But rc script was a nice bonus to it





			
				wblock said:
			
		

> vermaden: 4.0 seems the same performance-wise.  For me, one really good new feature is scaled mode, so it can finally show a large console while running in a X window.



Thanks mates


----------



## mix_room (May 24, 2011)

Doug, it seems that you are trying to run different versions of something. 


> ```
> May 24 09:20:18 Server kernel: SUP_IOCTL_COOKIE: Version mismatch.
> [B]Requested: 0x180000  Min: 0x180000  Current: 0x140001[/B]
> ```



Try rebuilding virtualbox-ose and virualbox-ose-kmod and then reinstalling them.

FWIW: I'm running 4.0.8 without problems.


----------



## _martin (May 24, 2011)

wblock said:
			
		

> It wasn't a problem with starting VMs, it was something like PR 139188


Oh yeah - I remember that one. But since that fix it's OK just to unload/load the modules. Or good enough as some memory leaks occurred.

@Doug: as mentioned above try to install it again. Make sure that old kernel modules are not loaded (to be on safe side). Also verify that both virtualbox-ose and virtualbox-ose-kmod are the same version after installation.


----------

