Running Virtualbox with FreeNAS as the host

Status
Not open for further replies.

ndboost

Explorer
Joined
Mar 17, 2013
Messages
78
So i have a pretty beefy FreeNAS build right now and a lot of the power is under utilizted. I wanted to combine two servers into one and install Virtualbox on FreeNAS either in a jail or on the main host.

I know virtualbox is available and stable on FreeBSD but i've never heard of anyone running it on the FreeNAS distro..

FreeBSD Wiki on VB: https://wiki.freebsd.org/VirtualBox

Anyone have any input on this? If its feasible i'd hazard on putting a plugin together for it if possible.
 

cheezehead

Dabbler
Joined
Oct 3, 2012
Messages
36
Would be nice to see a plugin for this. It should be doable but may require some kernel tuning. In theory it could run in a jail with some modifications but you'll also need to load phpvirtualbox and nginx or lighttpd to provide a usable interface for it.
 

ndboost

Explorer
Joined
Mar 17, 2013
Messages
78
I couldn't get it to build in a jail. I gave up and fired up a micro-atx system i had laying around ..
 

michaeleino

Dabbler
Joined
Jan 17, 2014
Messages
24
I couldn't get it to build in a jail. I gave up and fired up a micro-atx system i had laying around ..
Dear it's not easy at all... I can get it to work after a few weeks of tries,,, what is your prob. where u r stucked ???
1'st be sure to have the src files of kernel inside the jail...
or mount freenas src's into jail...
did you do that... I know the error has no indication that it needs the src files... that is the most bigger prob. if u can't build it.

I pass all that & get it to work with NAT, but also the latest kernel modules available here https://bugs.freenas.org/issues/1974
do enable you to use bridged mode.. but unfortunately don't pass any packets to the VM...

They are still working with it.... today I can see new modified mods available... I'll try... Hope to work.
 

michaeleino

Dabbler
Joined
Jan 17, 2014
Messages
24
I want to say it's working.... yes... FreeNAS as HOST VirtualBOX & PhpVirtualBox inside jail NAT & bridged mode :)
 

Xcapee

Dabbler
Joined
Aug 15, 2013
Messages
25
Hi @Micaeleino

Any chance you kept detailed notes enough to write up a tutorial? There are a lot of forum threads with questions about hosting VMs. Very few success stories. Your notes might make enough of a start to get a few folks contributing.
 

michaeleino

Dabbler
Joined
Jan 17, 2014
Messages
24
Look @Xcapee it's very very complicated....
first FreeNas should include the netgraph modified modules to the kernel (for Bridged mode) otherwise you will have the option to create NAT connections only.
Or you may will have to try this https://bugs.freenas.org/issues/1974#change-13014---- but leave the network connection later it's not problem, there is much complicated issues here.
The 1st trick when you create the jail is that choose it STANDARD the 64bit (this works with me, & don't tell me why... not plugin jail not port jail ) & you must give it IP & gateway & don't check NAT... check VIMAGE & if you want check autostart.
The 2nd trick before installing anything to jail, it is important to install the sources of the kernel to it so you can build your softwares...
You can install sources of FreeBSD or FreeNAS both works with me (but I think FreeNAS sources is better). for my FreeBSD9.2 Sources is this
ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/9.2-RELEASE/src.txz

OR the trueOS sourse(FreeNAS) from here https://github.com/trueos/trueos/releases/tag/9.2.0-RELEASE.... Please notice what is the version & arch you use.
Then u may have to forget FreeNAS & start relate with PURE FreeBSD system, start installing the webserver(apache or nginx & php5.3+)
after install virtualbox & phpvitualbox all installed from ports.
NOTE:if you can't install virtualbox & phpvirtualbox in a FreeBSD before you will almost fail with FreeNAS.

Sorry unfortunately I didn't write down what I do as it takes weeks or couple of months to get work... But I will build this again soon, & I promis that I will write down a step by step with screen shots.
 

xcom

Contributor
Joined
Mar 14, 2014
Messages
125
Look @Xcapee it's very very complicated....
first FreeNas should include the netgraph modified modules to the kernel (for Bridged mode) otherwise you will have the option to create NAT connections only.
Or you may will have to try this https://bugs.freenas.org/issues/1974#change-13014---- but leave the network connection later it's not problem, there is much complicated issues here.
The 1st trick when you create the jail is that choose it STANDARD the 64bit (this works with me, & don't tell me why... not plugin jail not port jail ) & you must give it IP & gateway & don't check NAT... check VIMAGE & if you want check autostart.
The 2nd trick before installing anything to jail, it is important to install the sources of the kernel to it so you can build your softwares...
You can install sources of FreeBSD or FreeNAS both works with me (but I think FreeNAS sources is better). for my FreeBSD9.2 Sources is this
ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/9.2-RELEASE/src.txz
OR the trueOS sourse(FreeNAS) from here https://github.com/trueos/trueos/releases/tag/9.2.0-RELEASE.... Please notice what is the version & arch you use.
Then u may have to forget FreeNAS & start relate with PURE FreeBSD system, start installing the webserver(apache or nginx & php5.3+)
after install virtualbox & phpvitualbox all installed from ports.
NOTE:if you can't install virtualbox & phpvirtualbox in a FreeBSD before you will almost fail with FreeNAS.

Sorry unfortunately I didn't write down what I do as it takes weeks or couple of months to get work... But I will build this again soon, & I promis that I will write down a step by step with screen shots.


Well it was not complicated. Building the modules was easy. Installing virtualbox was simple using the ports. Now I am running in to issues with understanding where the modules have to reside. I compile all the necessary modules for bridge networking. Where do this go? under /boot/kernel of freenas or the jail?

Thank you for the help all.
 

xcom

Contributor
Joined
Mar 14, 2014
Messages
125
Dear @xcom ,
Don't build the modules yourself.... this doesn't work with me... use instead the modules provided from https://bugs.freenas.org/issues/1974#change-13014
before looking at netgraph... can you start a VM ??? with NAT or whatever without Network interface!!?
then try to see how to fix netgraph!


michaeleino,

I am sorry but I am not understanding what you are trying to say. Not to build the modules?
If is not working for you is because you are not applying the ether patch or you are doing something wrong. I also see that you are using centos jail as per the post on that thread... I am using freebsd. Any who... If you don't apply the ether patch it will build ng_ether.ko with an invalid dynamic link and the kernel rejects it.
I also edited the patch to include a small modification that was causing it to failed while compiling.
With all this I build the modules just fine. I can start virtualbox on bridge mode and life is good.
 

michaeleino

Dabbler
Joined
Jan 17, 2014
Messages
24
No i'm using FreeBSD STANDARD jail....
I have tried about weeks... but modules from bug tracker works like a charm...
even applying ether patch or not even I do researches for long times... I can get it to have a connection to guest system but there was no packets sent over it... can't ping can't browse can't optain IP from DHCP... Just a dummy connection!!! so I tell to use the kernel modules from bug tracker link :)
 

xcom

Contributor
Joined
Mar 14, 2014
Messages
125
No i'm using FreeBSD STANDARD jail....
I have tried about weeks... but modules from bug tracker works like a charm...
even applying ether patch or not even I do researches for long times... I can get it to have a connection to guest system but there was no packets sent over it... can't ping can't browse can't optain IP from DHCP... Just a dummy connection!!! so I tell to use the kernel modules from bug tracker link :)

Ah I got confused.

Well those modules did not work for me. And the ether patch need it some work for it to work correctly... The edited ether patch is on my post.... Any who I build my own modules without a problem. On that same note I wont load anything to the kernel that I do not know the source ;)
 

michaeleino

Dabbler
Joined
Jan 17, 2014
Messages
24
Ah I got confused.

Well those modules did not work for me. And the ether patch need it some work for it to work correctly... The edited ether patch is on my post.... Any who I build my own modules without a problem. On that same note I wont load anything to the kernel that I do not know the source ;)
I was working with freenas 9.1 and those modules works.. exactly those ( https://bugs.freenas.org/issues/1974#note-15 )
all that should be just tests :D not a production environment... so no problem for me to add anything to anywhere I won't lose anything ;)
 
Status
Not open for further replies.
Top