Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Headless Virtualbox with phpVirtualbox

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    1

    Headless Virtualbox with phpVirtualbox

    I made an attempt setting this up but I will need help with this.

    First, installing Virtualbox:

    There is a port for FreeBSD, but its not available with "pkg_add -r virtualbox". Looks like ports needs to be installed and configured.

    Second, installing phpVirtualbox:

    Doing a "pkg_add -r phpvirtualbox" installs it. But it looks like it does not resolve the php dependencies. I would assume a "pkg_add -r php" would take care of that.

    Third, using the existing lighttpd for phpvirtualbox:

    I would like to just use the existing webserver by putting the files in a sub-directory. e.g 192.168.1.2/phpvirualbox. Also lighttpd would most likely need to be configured for php, seeing that FreeNAS uses python.

    So to summarize the questions:
    What is the best way to install/configure ports?
    Would pkg_add -r php install the php dependencies?
    Would using the existing lighttpd be the best way to serve the phpvirtualbox files?

    BTW, I am a complete BSD noob. I am more useful with a linux machine.

  2. #2
    Senior Member
    Join Date
    Jun 2011
    Posts
    100
    Hey,

    I'm also planning on running VirtualBox Headless using phpVirtualBox inside my FreeNAS, but I'm still waiting for my ordered components to arrive. In the meantime I'm doing some research on how to do it and I am very interrested in your progress and possible tips and tricks if you succeed.

    I'm an experienced linux user, but this will be my first BSD experience.
    Maybe I can give you a hint on installing virtualbox. If I remember correctly the package/port name isn't 'virtualbox' but 'virtualbox-ose'. Maybe if you try that you will be able to install virtualbox.
    If you didn't know already, there is a website where you can search for ports/packages: freshports.org/

  3. #3
    Junior Member
    Join Date
    Jun 2011
    Posts
    4

    Cool

    Hello,
    running phpvirtualbox isn't very simple, since you have to modify many files in the base system. The result will be a custom system which is hard to upgrade. For example modifying lighty and some system configurations.
    To get sufficient results you need to recompile the kernel/modules. Since jailing phpvirtualbox isn't very easy a chroot should help you to provide necessary stuff.
    Setting up phpvirtualbox wasn't a big deal on my FreeNAS, the biggest work is to fix some build problems with 32bit combatibility on my amd64 FreeNAS for virtualbox-ose 4.x, to get a easy to share system.

    Anonymous

  4. #4
    Junior Member
    Join Date
    Sep 2011
    Posts
    26
    Quote Originally Posted by Anonymous View Post
    Setting up phpvirtualbox wasn't a big deal on my FreeNAS, the biggest work is to fix some build problems with 32bit combatibility on my amd64 FreeNAS for virtualbox-ose 4.x, to get a easy to share system.

    Anonymous
    Any chance you could share those steps? I am new to freebsd/freenas but would really love to get virtualbox installed on my freenas 8.0.1 box so i can shut down one of my other boxes. Just want to run a reverse proxy and a few other things until they become available as part of freenas.

    Seer

  5. #5
    Administrator
    Join Date
    May 2011
    Posts
    261
    PBI requested (http://forums.pcbsd.org/showthread.php?p=89054) so it will be available when the plugin architecture is released with 8.1.

  6. #6
    Junior Member
    Join Date
    Sep 2011
    Posts
    26
    Quote Originally Posted by admin View Post
    PBI requested (http://forums.pcbsd.org/showthread.php?p=89054) so it will be available when the plugin architecture is released with 8.1.
    Thanks. I know that most of the software i want will be available in 8.1 as plugins but the issue i have is there is no set release date for 8.1, i don't think the current 8.1 daily snapshots have plugin support or work correctly and i really need something to fill the gap between now and the release of 8.1.

    I have all the download software installed and working correctly following other guides so I am sort of hoping to find a similar way to get virtual box working especially since others are saying they did it easily

    I am sure others would happily use this option till the plugins are properly implemented as well.

  7. #7
    Junior Member wookie's Avatar
    Join Date
    Mar 2012
    Posts
    13

    Lightbulb Virtualbox-OSE and phpvirtualbox in the PBI Jail (Near Success)

    I am getting close to running a headless Virtualbox-OSE and phpvirtualbox in the PBI Jail
    in FreeNAS 8.2.0-BETA2 (amd64).

    It has not been so straight forward...

    1. Set up your PBI Jail ala the manual:
    http://doc.freenas.org/index.php/Plu...orts_with_make
    And login to your jail:
    Code:
    jexec 1 /bin/tcsh
    2. Install the ports tree:
    Code:
    portsnap fetch 
    portsnap extract
    portsnap update
    3. To get it to build you will need AISL however there will be a slight problem because FreeNAS is built WITHOUT_ACPI.
    So you need to find yourself a copy of /usr/sbin/aisl from some other vanilla FreeBSD 8.2 install and place it into the
    equivalent directory in your jail.

    4. You will also need some kernel sources.
    I installed subversion from ports in the jail so I could do this:
    Code:
     
    svn checkout svn://svn.freebsd.org/base/releng/8.2/sys /usr/src/sys
    5. OK time for the port build of virtualbox.
    Code:
    cd /usr/ports/emulators/virtualbox-ose
    make config
    Here is what i configured:
    vbox_config.jpg

    Now build and install:
    Code:
    make install
    Virtualbox should now be *nearly* installed.

    Virtualbox needs its kernel module to be installed in the host.
    So in the host (NOT the jail) load the module:
    Code:
    kldload /mnt/<yourjailpath>/boot/modules/vboxdrv.ko
    Then you need to enable this device in the jail.
    I did this also from the host via devfs:
    Code:
    mount -t devfs devfs /mnt/<yourjailpath>/dev
    6. Installing phpvirtualbox in the jail should be no problems**:
    Code:
    cd /usr/ports/www/phpvirtualbox
    make install
    ** You will probably need some further configuration to get phpvirtualbox, PHP and a webserver working in the jail together.
    However I am sure you can figure all that part from here. Once you get it configured, point your browser to your phpvirtualbox install.


    --
    Anyway I do have a test VM working though I have some issues with getting a bridged adapter to work in a Virtual Machine
    There are some other modules that need to be loaded in the kernel; vboxnetflt.ko and vboxnetadp.ko
    However I am getting a dependency error in the host with netgraph and vboxnetflt.

    To tell you the truth I am not a wizard at any of this stuff, I am just playing around.
    Though I would love if someone else would try this out.

    My general thoughts are making me believe that turning this into a working PBI plugin in a jailed environment is going to be tricky.
    Kernel modules cannot be loaded from within a jail and some host dependencies need to be resolved.
    Though as I said I am no expert, I have never made a PBI before.

    If anybody else gets this to go further please post here..

  8. #8
    Junior Member
    Join Date
    May 2012
    Posts
    1
    I was able to get past the netgraph dependency by fetching the kernel source and building netgraph.ko, but I still have not been able to get the bridged adapter to work. Have you made any progress with this yourself?

  9. #9
    Junior Member wookie's Avatar
    Join Date
    Mar 2012
    Posts
    13
    Unfortunately I have been locked down in work + personal life to find the extra time to pursue this, though I still intend to push with it when I see some light. As I said before, I have a funny feeling that running it in a jail is not so easy. We might have to create a modified FreeNAS build.

  10. #10
    Junior Member
    Join Date
    Apr 2012
    Posts
    6

    First Attempt

    I made an initial attempt this morning at getting this to work by simply installing the BSD ports, but that's not an option as the virtualbox-ose package is built without webservice enabled. I will try again and follow wookie's steps, and report on results.

    I am running into a significant issue which is that the jail bridge network adapter screws up my AFP service. I'm able to browse my AFP shares, but loading a file is excruciatingly slow, making the NAS effectively unusable while the jail is running. This may be due to the link aggregation I'm using, so I'll see if disabling and just using one network adapter makes the issue go away.

    It seems that there have been others who have successfully run virtualbox within a jail.

    Some updates:
    I tried installing subversion from the freshports package:
    Code:
    pkg_add -r subversion
    This results in an error message due to a shared library revision issue:
    Code:
    ld-elf.so.1: Shared object "libgdbm.so.3" not found, required by "svn"
    You can correct this by creating a symbolic link:
    Code:
    ln -s /usr/local/lib/libgdbm.so.4 /usr/local/lib/libgdbm.so.3
    When building virtual box I get a package version mismatch error, which I haven't resolved yet:
    Code:
    ===>  Installing for pkgconf-0.8.3_1
    
    ===>  pkgconf-0.8.3_1 conflicts with installed package(s): 
          pkg-config-0.25_1
    
          They install files into the same place.
          Please remove them first with pkg_delete(1).
    *** Error code 1
    
    Stop in /usr/ports/devel/pkgconf.
    *** Error code 1
    
    Stop in /usr/ports/textproc/libxslt.
    *** Error code 1
    
    Stop in /usr/ports/textproc/libxslt.
    *** Error code 1
    
    Stop in /usr/ports/emulators/virtualbox-ose.
    *** Error code 1
    
    Stop in /usr/ports/emulators/virtualbox-ose.
    Maybe it would be easier to build FreeNAS from source with Virtualbox built-in...
    Last edited by johnstonjs; 07-29-2012 at 06:11 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •