Virtualbox jail not running after virtualbox-ose-kmod updated

Status
Not open for further replies.

styno

Patron
Joined
Apr 11, 2016
Messages
466
fyi, if you re-bootstrap pkg you can actually upgrade the packages in the current jail.
Code:
/usr/sbin/pkg bootstrap -f
pkg update -f
pkg upgrade

BUT, this does not mean you can skip the rest of @Kam's procedure as you need to install apache24, php and reconfigure permissions and apply the workarounds anyways... So what I thought was going to save me a lot of time ends now with me being rolled-back to 9.10.1-U4 and leave this for the next year...

happy new-year! ;)
 
Joined
Jun 13, 2013
Messages
25
A thousand thank yous!

After thinking I'd broken virtualbox by fiddling I started wondering if the update had broken something. And finally I arrive here.

New jail created, pkg's updated and installed and chrome cache cleared - and now my vm is running again.

:) :) :)
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
Thanks a lot for this instruction @Kam my VirtualBox and VM is working again.

I do have one issue though: USB passthrough does not seem to work anymore in this version of VirtualBox. Apparently, as discussed here as well, FreeBSD 10.3 + VirtualBox 5.1.6 have this issue while version 5.0.26 doesn't have this issue. Does anyone have a solution for this? I did look for the package for this version but was unable to find it so I am now trying build it from ports and when that is finished I will try to use portdowngrade. This is new for me so if anyone knows where to find the package for this version or can help and has any ideas for a (quicker) solution would be highly appreciated.
 

rosabox

Explorer
Joined
Jun 8, 2016
Messages
77
I'm very interested in USB passthrough.
If you manage to make it work, can you please post how you did it?
Thank you.
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
Well I had it running in the previous version of VirtualBox using this guide as mentioned in this post. Worked without any issues for a long time but in this version of VirtualBox it seems to be broke. I run into multiple issues while trying to compile the current ports version of VirtualBox so again if someone can help with getting VirtualBox 5.0.26 installed in a jail would be great since my vm is not really usable right now without my z-wave usb stick.
 
Last edited:

ArgaWoW

Patron
Joined
Jul 4, 2015
Messages
444
Hello,
Hi all,
as part of Feature #18630 Update to 2016Q4 Ports Tree is updated virtualbox-ose-kmod from 4.3.34 to 5.1.6:

current night build FreeNAS-9.10-MASTER-201612100422 (4d7d293)
[root@freenas3] ~# pkg info | grep -i virtualbox
virtualbox-ose-kmod-5.1.6 VirtualBox kernel module for FreeBSD

last stable FreeNAS-9.10.1-U4 (ec9a7d3)
[root@freenas] ~# pkg info |grep virtualbox
virtualbox-ose-kmod-4.3.34 VirtualBox kernel module for FreeBSD

Because of this update startup of Virtualbox VM in virtualbox jail fails and in "dmesg" output is error:
SUP_IOCTL_COOKIE: Version mismatch. Requested: 0x1a0007 Min: 0x1a0005 Current: 0x260000

Will you create new virtualbox jail template with 5.1.6 vbox version?

With 9.10 are many users using virtualbox jail and freenas 10 is not yet out.

If not, here are steps how to create new virtualbox jail yourself, for those, who want to still use virtualbox with current 9.10 version after update of virtualbox-ose-kmod to 5.1.6.

Before that, backup your machines in original virtualbox jail, so that you can move them to new jail after creation.

Steps to create new virtualbox jail
===================================
Jails -> Add Jail -> "virtualbox"
- this will create standart freebsd jail, do not choose old vbox template

jexec virtualbox

vi /usr/local/etc/pkg/repos/FreeBSD.conf
- url: "pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/latest",
+ url: "pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/quarterly",

pkg upgrade
pkg install virtualbox-ose phpvirtualbox apache24 mod_php56

adduser

Username: vbox
Full name: vbox
Uid (Leave empty for default): 1001
Login group [vbox]:
Login group is vbox. Invite vbox into other groups? []: vboxusers
Login class [default]:
Shell (sh csh tcsh git-shell nologin) [sh]:
Home directory [/home/vbox]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password:VBox123
Enter password again:VBox123
Lock out the account after creation? [no]:
Username : vbox
Password : *****
Full Name : vbox
Uid : 1001
Class :
Groups : vbox vboxusers
Home : /home/vbox
Home Mode :
Shell : /bin/sh
Locked : no
OK? (yes/no): y
adduser: INFO: Successfully added (vbox) to the user database.
Add another user? (yes/no): no
Goodbye!

vi /etc/rc.conf
+ apache24_enable="YES"
+ vboxwebsrv_user="vbox"
+ vboxwebsrv_enable="YES"

service vboxwebsrv start

vi /usr/local/www/phpvirtualbox/config.php
- var $password = 'pass';
+ var $password = 'VBox123';

vi /usr/local/etc/apache24/httpd.conf
- DocumentRoot "/usr/local/www/apache24/data"
+ DocumentRoot "/usr/local/www/phpvirtualbox"
- <Directory "/usr/local/www/apache24/data">
+ <Directory "/usr/local/www/phpvirtualbox">

# In section <IfModule mime_module>, add after x-gzip type for php module:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
#
+ AddType application/x-httpd-php .php
+ AddType application/x-httpd-php-sources .phps
#

# workaround for older phpvirtualbox-5.0.5
vi /usr/local/www/phpvirtualbox/endpoints/api.php
- $response['data']['responseData']['phpvboxver'] = @constant('PHPVBOX_VER');
+ $response['data']['responseData']['phpvboxver'] = "5.1-0";

service apache24 start

ifconfig -a|grep inet

http://x.x.x.x
admin/admin

Enjoy!

I would create also template from this, but do now know how..
Kam

Hello,

I have installed the virtualbox according to your steps above and I am able to log in. I want to install Windows10 64bit in a vm, but when I start it i got this error message:

The virtual machine 'windows10' has terminated unexpectedly during startup with exit code 1 (0x1)

I would be very happy if anyone can help to solve this issue.

Tanks in advance :)
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
I managed to downgrade to Virtualbox 5.0.26_OSE by installing the latest version from portsnap and then do the following:

Code:
rm -rf /usr/ports
svn checkout https://96.47.72.69/ports/head /usr/ports
cd /usr/ports/emulators/virtualbox-ose
svn up -r 420152
make deinstall install


Got that solution from this forum post. Then I followed the steps from the first post of this topic. But when I now try to start the VM I get the same error as @ArgaWoW above mentions: "The virtual machine 'Debian Jessie' has terminated unexpectedly during startup with exit code 1 (0x1)"

Any ideas on how to fix this?
 

Joe Archer

Dabbler
Joined
Aug 15, 2016
Messages
23
@wmn79 and @ArgaWoW Are you two updated to the latest FreeNAS? I just updated today and tried the fix in this forum post, but it appears that I can't access my VM's as well. It appears possibly that the Kernel updates in the latest version don't have the latest version of VirtualBox modules in them. I'm seeing the mismatch error, but it's saying

Code:
Version Mismatch. Requested: 0x280000 Min: 0x280000 Current: 0x26000


Are you experiencing the same error message? (Check with
Code:
dmesg
command in the jail. Or in the console on the FreeNAS Web GUI.
 

Joe Archer

Dabbler
Joined
Aug 15, 2016
Messages
23
I think you might have skipped one of the first steps:
vi /usr/local/etc/pkg/repos/FreeBSD.conf
- url: "pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/latest",
+ url: "pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/quarterly",

because it looks like your installed virtualbox-ose version (0x280000) is higher than the virtualbox-ose-kmod version (0x26000).
I thought I did too, but I double checked and I didn't miss that part. From what I can see, it looks like the package was updated on the 3rd to 5.1.12. Currently I'm trying to downgrade to 5.1.6 so that it matches up. I also looked into updated the kernel module, but that'd have to be done outside the Jail, and I don't want to mess with that.
 

ArgaWoW

Patron
Joined
Jul 4, 2015
Messages
444
If you find a way to downgrade, please tell me how you done this. I also need to know, how / if I can transfer my vm machines from the old jail to the new jail.

Thanks in advance for your time

Gesendet von meinem LG-H850 mit Tapatalk
 

shamo316

Dabbler
Joined
Jun 21, 2016
Messages
30
I thought I did too, but I double checked and I didn't miss that part. From what I can see, it looks like the package was updated on the 3rd to 5.1.12. Currently I'm trying to downgrade to 5.1.6 so that it matches up. I also looked into updated the kernel module, but that'd have to be done outside the Jail, and I don't want to mess with that.
If you find a way to downgrade, please tell me how you done this. I also need to know, how / if I can transfer my vm machines from the old jail to the new jail.

Thanks in advance for your time

Gesendet von meinem LG-H850 mit Tapatalk

Is there a fix for this yet?
 

Joe Archer

Dabbler
Joined
Aug 15, 2016
Messages
23
To update, I wasn't successful in getting a downgrade working and admitting defeat.

I was able to export the machines via the webUI before destroying the Jail. You just need to select export appliance at the top, and this will give you an ova file to restore on another machine. Or, if you search earlier in this forum post, it has instructions on moving the folders that contain the VM's into another section.
 

Darren Smith

Dabbler
Joined
Jun 30, 2015
Messages
20
Hi all,
as part of Feature #18630 Update to 2016Q4 Ports Tree is updated virtualbox-ose-kmod from 4.3.34 to 5.1.6:

current night build FreeNAS-9.10-MASTER-201612100422 (4d7d293)
[root@freenas3] ~# pkg info | grep -i virtualbox
virtualbox-ose-kmod-5.1.6 VirtualBox kernel module for FreeBSD

last stable FreeNAS-9.10.1-U4 (ec9a7d3)
[root@freenas] ~# pkg info |grep virtualbox
virtualbox-ose-kmod-4.3.34 VirtualBox kernel module for FreeBSD

Because of this update startup of Virtualbox VM in virtualbox jail fails and in "dmesg" output is error:
SUP_IOCTL_COOKIE: Version mismatch. Requested: 0x1a0007 Min: 0x1a0005 Current: 0x260000

Will you create new virtualbox jail template with 5.1.6 vbox version?

With 9.10 are many users using virtualbox jail and freenas 10 is not yet out.

If not, here are steps how to create new virtualbox jail yourself, for those, who want to still use virtualbox with current 9.10 version after update of virtualbox-ose-kmod to 5.1.6.

Before that, backup your machines in original virtualbox jail, so that you can move them to new jail after creation.

Steps to create new virtualbox jail
===================================
Jails -> Add Jail -> "virtualbox"
- this will create standart freebsd jail, do not choose old vbox template

jexec virtualbox

vi /usr/local/etc/pkg/repos/FreeBSD.conf
- url: "pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/latest",
+ url: "pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/quarterly",

pkg upgrade
pkg install virtualbox-ose phpvirtualbox apache24 mod_php56

adduser

Username: vbox
Full name: vbox
Uid (Leave empty for default): 1001
Login group [vbox]:
Login group is vbox. Invite vbox into other groups? []: vboxusers
Login class [default]:
Shell (sh csh tcsh git-shell nologin) [sh]:
Home directory [/home/vbox]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password:VBox123
Enter password again:VBox123
Lock out the account after creation? [no]:
Username : vbox
Password : *****
Full Name : vbox
Uid : 1001
Class :
Groups : vbox vboxusers
Home : /home/vbox
Home Mode :
Shell : /bin/sh
Locked : no
OK? (yes/no): y
adduser: INFO: Successfully added (vbox) to the user database.
Add another user? (yes/no): no
Goodbye!

vi /etc/rc.conf
+ apache24_enable="YES"
+ vboxwebsrv_user="vbox"
+ vboxwebsrv_enable="YES"

service vboxwebsrv start

vi /usr/local/www/phpvirtualbox/config.php
- var $password = 'pass';
+ var $password = 'VBox123';

vi /usr/local/etc/apache24/httpd.conf
- DocumentRoot "/usr/local/www/apache24/data"
+ DocumentRoot "/usr/local/www/phpvirtualbox"
- <Directory "/usr/local/www/apache24/data">
+ <Directory "/usr/local/www/phpvirtualbox">

# In section <IfModule mime_module>, add after x-gzip type for php module:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
#
+ AddType application/x-httpd-php .php
+ AddType application/x-httpd-php-sources .phps
#

# workaround for older phpvirtualbox-5.0.5
vi /usr/local/www/phpvirtualbox/endpoints/api.php
- $response['data']['responseData']['phpvboxver'] = @constant('PHPVBOX_VER');
+ $response['data']['responseData']['phpvboxver'] = "5.1-0";

service apache24 start

ifconfig -a|grep inet

http://x.x.x.x
admin/admin

Enjoy!

I would create also template from this, but do now know how..
Kam

Probably a silly question but what are you using to make all this happen? I've tried the built in 'shell' without success...
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
I use putty to connect to my FreeNAS machine, not specifying a specific shell. For FreeNAS it is Bash I believe if you do jexec you can specify the shell you want. If you don't do this as in Kam's explanation you get the standard shell I think which is not Bash for the jails.
 

Kam

Dabbler
Joined
Mar 28, 2016
Messages
39
as some of you mentioned, virtualbox in quarterly repository was updated to newer version. as kernel module is shipped with freenas and I think we should not update them, we need somewhere find how to install older 5.1.6 version of virtualbox in jail. but to be honest, i haven't found from where to download it. and I'm not so experienced with freebsd to know hot to build old port.
if anyone finds how to get 5.1.6 version, please post it.
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
as some of you mentioned, virtualbox in quarterly repository was updated to newer version. as kernel module is shipped with freenas and I think we should not update them, we need somewhere find how to install older 5.1.6 version of virtualbox in jail. but to be honest, i haven't found from where to download it. and I'm not so experienced with freebsd to know hot to build old port.
if anyone finds how to get 5.1.6 version, please post it.
I think you can do that by following these instructions on your current jail:
Code:
rm -rf /usr/ports
svn checkout https://96.47.72.69/ports/head /usr/ports
cd /usr/ports/emulators/virtualbox-ose
svn up -r 423390
make deinstall install

The specific revision can be found on the freshports page for virtualbox-ose under commit history. I think
Revision 423390 should be the one to use since the newer one seems to be the update to 5.1.8 already.

If you start with a new jail you can remove "deinstall" from the last instruction and add "clean". so "make deinstall install" would change to "make install clean".

Good luck!
 
Last edited:

Kam

Dabbler
Joined
Mar 28, 2016
Messages
39
I found that I have older virtualbox package still in a cache on one machine
root@virtualbox:/var/cache/pkg # ls -la /var/cache/pkg/virtualbox-ose-5.1.6_1-b81cf4010c.txz
-rw-r--r-- 1 root wheel 42999872 Dec 15 07:53 /var/cache/pkg/virtualbox-ose-5.1.6_1-b81cf4010c.txz
is it possible to copy it to jail on other machine and install it from file? with which "pkg" command?

EDIT: thanks for example with ports, I will try it.
 

JoeB

Contributor
Joined
Oct 16, 2014
Messages
121
I've tried the instructions from post 1, but i get incorrect username or password when i try to log in to VB.

I've checked the password in Config.php and it is correct. I've used "passwd vbox" to change the users password aswell. No luck, any ideas?
 

Kam

Dabbler
Joined
Mar 28, 2016
Messages
39
vbox user is used internally. for VB interface use admin/admin
 
Status
Not open for further replies.
Top