Because ClearOS has such a small footprint it actually makes quite a good VM server for various guest OS's.
There are threads on VMWare in the forum, and how to get that setup - so i'd thought i'd have a go with VirtualBox which also has a headerless function which can be viewed using standard Windows Remote Desktop. This makes it great for running remote OS's
The latest version of VirtualBox is 3.1.2 however this version made some config changes from 3.0.x to the way in which storage controllers and resources are called up (long story short to enable more than one DVD drive etc)...I had more success with the tried and tested 3.0.12 method so this Howto is based around that version. Hopefully in future we'll be able to update this with the newer version. Be careful when googling for info as the syntax changed between versions.
INSTALLATION
First up you will need the devel tools to enable the kernel modules to be compiled during install. If you are running the PAE kernel, replace with kernel-PAE-devel
Download the RPM for RHEL5 i386
Installation will create a group called vboxusers, we need to add a user to this group, or create a seperate vbox specific user. I went for the latter as I wanted to keep it separate from my other accounts. User is named 'vbox' for example, we also then add the user to the vboxusers group
VirtualBox is not LDAP aware so these need to be system user / accounts, hence the -r flag for useradd. It should create a user with an SID < 500 so that it is not removed by the system at a later date.
This should confirm that you user has been created and associated with the group
cat /etc/passwd | grep vbox
cat /etc/group | grep vbox
CREATE AND CONFIGURE A VM
Now on to the fun bit...! Creating a VM ( I won't touch on importing your own *.vdi or *.ovf appliances here, have a read of the VirtualBox manual over here for clues http://www.virtualbox.org/manual/UserManual.html
First switch to the new user, then we will start to create the VM. Note using the GUI is so much easier but we don't want the overheads of the full X system so stick with it it will start to make some sense
Again NOTE sysntax has changed for the new 3.1.2 version, this applies to 3.0.12
Outline steps are:- switch to vbox user (all configuration is by default stored in /home/vbox/.VirtualBox/ subfolders
Create the VM name and register it, remember this or write it down, I called mine Windows XP
This should return without error. The VM will be created under /home/vbox/.VirtualBox/Machines/...you can of course symlink this to another directory on the system if you wish
Now to setup some basic parameters for the VM. We are using 512MB, boot DVD first, use basic bridged connection with the LAN interface to give it internet access. You can also specifcy --nic2 etc...or --nic1 nat. See VBoxManage man page for full config details
Now to create the VM HD, set to 10GB, and stored under /home/vbox/.VirtualBox/HardDisks/. We then assign this HD to our VM as the primary HD device hda
Next step to register our installation ISO with VirtualBox (this is akin to the media manager if you've used the GUI before). We then register this as the DVD drive associated with our VM. The ISO can live anywhere on your system as long as vbox can read it.
START YOUR VM
Thats it! a basic config that should now get a VM install running. To start our VM headerless we now run the following, and then connect remotely using Windows Remote Desktop to ClearOS (port 3389 is used by default). Note the & at the end, this will force it to run in the background, so you should ensure you shutdown the VM correctly or use VBoxManage to control / save the states on exit)
To detach the DVD iso (i.e. eject it) use the following
You may also try - if the VM is running
GUEST ADDITIONS
Now I found that the display and mouse did not correlate very well until I install the guest additions. So....register and attach the guest additons ISO, then boot your VM and run the installer from within the OS
Enjoy!
For more configuration options refer to http://www.virtualbox.org/manual/UserManual.html#vboxmanage-modifyvm Particularly for increasing the video card memory size, NIC options etc.
TIPS - To be completed....
Want to see a VM config? use VBoxManage showvminfo "WindowsXP"
Want to see HD config? use VBoxManage showhdinfo harddiskname.vdi
Want to change Video RAM allocated to VM? use VBoxManage modifyvm "WindowsXP" --vram 128MB
Want to enable USB and USB2.0? use VBoxManage modifyvm "WindowsXP" --usb on --usbehci on
Want to shutdown a VM? use VBoxManage controlvm "WindowsXP" acpipowerbutton (for instant off, use poweroff)
Need to press CTRL-ALT-DEL to login over RDP? it's locked solely to the local machine, so use CTRL-ALT-END instead
Want to see other ostypes? use VBoxManage list ostypes
There are threads on VMWare in the forum, and how to get that setup - so i'd thought i'd have a go with VirtualBox which also has a headerless function which can be viewed using standard Windows Remote Desktop. This makes it great for running remote OS's
The latest version of VirtualBox is 3.1.2 however this version made some config changes from 3.0.x to the way in which storage controllers and resources are called up (long story short to enable more than one DVD drive etc)...I had more success with the tried and tested 3.0.12 method so this Howto is based around that version. Hopefully in future we'll be able to update this with the newer version. Be careful when googling for info as the syntax changed between versions.
INSTALLATION
First up you will need the devel tools to enable the kernel modules to be compiled during install. If you are running the PAE kernel, replace with kernel-PAE-devel
yum groupinstall "Development Tools"
yum install kernel-devel
Download the RPM for RHEL5 i386
cd /var/tmp
wget http://download.virtualbox.org/virtualbox/3.0.12/VirtualBox-3.0.12_54655_rhel5-1.i386.rpm
yum localinstall VirtualBox-3.0.12_54655_rhel5-1.i386.rpm
Installation will create a group called vboxusers, we need to add a user to this group, or create a seperate vbox specific user. I went for the latter as I wanted to keep it separate from my other accounts. User is named 'vbox' for example, we also then add the user to the vboxusers group
/usr/sbin/useradd -r -m vbox
/usr/sbin/usermod -a -G vboxusers vbox
VirtualBox is not LDAP aware so these need to be system user / accounts, hence the -r flag for useradd. It should create a user with an SID < 500 so that it is not removed by the system at a later date.
This should confirm that you user has been created and associated with the group
cat /etc/passwd | grep vbox
cat /etc/group | grep vbox
CREATE AND CONFIGURE A VM
Now on to the fun bit...! Creating a VM ( I won't touch on importing your own *.vdi or *.ovf appliances here, have a read of the VirtualBox manual over here for clues http://www.virtualbox.org/manual/UserManual.html
First switch to the new user, then we will start to create the VM. Note using the GUI is so much easier but we don't want the overheads of the full X system so stick with it it will start to make some sense
Again NOTE sysntax has changed for the new 3.1.2 version, this applies to 3.0.12
Outline steps are:- switch to vbox user (all configuration is by default stored in /home/vbox/.VirtualBox/ subfolders
Create the VM name and register it, remember this or write it down, I called mine Windows XP
su vbox
VBoxManage createvm --name "WindowsXP" --ostype "WindowsXP" --register
This should return without error. The VM will be created under /home/vbox/.VirtualBox/Machines/...you can of course symlink this to another directory on the system if you wish
Now to setup some basic parameters for the VM. We are using 512MB, boot DVD first, use basic bridged connection with the LAN interface to give it internet access. You can also specifcy --nic2 etc...or --nic1 nat. See VBoxManage man page for full config details
VBoxManage modifyvm "WindowsXP" --memory "512MB" --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 eth0
Now to create the VM HD, set to 10GB, and stored under /home/vbox/.VirtualBox/HardDisks/. We then assign this HD to our VM as the primary HD device hda
VBoxManage createhd --filename "WinXP.vdi" --size 10000 --remember
VBoxManage modifyvm "WindowsXP" --hda "WinXP.vdi"
Next step to register our installation ISO with VirtualBox (this is akin to the media manager if you've used the GUI before). We then register this as the DVD drive associated with our VM. The ISO can live anywhere on your system as long as vbox can read it.
VBoxManage openmedium dvd /full/path/to/iso.iso
VBoxManage modifyvm "WindowsXP" --dvd /full/path/to/iso.iso
START YOUR VM
Thats it! a basic config that should now get a VM install running. To start our VM headerless we now run the following, and then connect remotely using Windows Remote Desktop to ClearOS (port 3389 is used by default). Note the & at the end, this will force it to run in the background, so you should ensure you shutdown the VM correctly or use VBoxManage to control / save the states on exit)
VBoxHeadless --startvm "WindowsXP" &
To detach the DVD iso (i.e. eject it) use the following
VBoxManage modifyvm "WindowsXP" --dvd none
You may also try - if the VM is running
VBoxManage controlvm "WindowsXP" dvdattach none
GUEST ADDITIONS
Now I found that the display and mouse did not correlate very well until I install the guest additions. So....register and attach the guest additons ISO, then boot your VM and run the installer from within the OS
VBoxManage openmedium dvd /usr/share/virtualbox/VBoxGuestAdditions.iso
VBoxManage modifyvm "WindowsXP" --dvd /usr/share/virtualbox/VBoxGuestAdditions.iso
Enjoy!
For more configuration options refer to http://www.virtualbox.org/manual/UserManual.html#vboxmanage-modifyvm Particularly for increasing the video card memory size, NIC options etc.
TIPS - To be completed....
Want to see a VM config? use VBoxManage showvminfo "WindowsXP"
Want to see HD config? use VBoxManage showhdinfo harddiskname.vdi
Want to change Video RAM allocated to VM? use VBoxManage modifyvm "WindowsXP" --vram 128MB
Want to enable USB and USB2.0? use VBoxManage modifyvm "WindowsXP" --usb on --usbehci on
Want to shutdown a VM? use VBoxManage controlvm "WindowsXP" acpipowerbutton (for instant off, use poweroff)
Need to press CTRL-ALT-DEL to login over RDP? it's locked solely to the local machine, so use CTRL-ALT-END instead
Want to see other ostypes? use VBoxManage list ostypes
Share this post:
Responses (157)
-
Accepted Answer
-
Accepted Answer
ClearOS 7 VirtualBox 5 implementation.
I've got an old XP computer which we need to keep running. I have it virtualized using the Microsoft tool DISK2VHD.EXE in the physical PC. It makes sure the drivers are there in the VHD for VirtualBox to use. Now running in VirtualBox on Linux Mint 18. I've managed to launch it headless from the command line with the -vrde on option having used VBoxManage to set the VNC password as shown in an earlier post here. Then I can VNC to it provided I connect to the virtual machine's IP not my hosts IP. Probably worth setting it to bridged networking and setting a static IP.
It seems to me unnecessary to have a graphical user interface on the ClearOS server and that all that's required is to create your Virtual Machine somewhere else before moving it to the ClearOS server. Am I correct or are the graphical bits required in the headless VirtualBox? -
Accepted Answer
Hi,
Thanks to Tim for the nice How to install virtualbox headless. I just wonder what I need to install to get the 3D acceleration working? I guess:
- 3D graphic card (Nvidia)
- X
- Desktop?
It is just strange to me, that the option 3D acceleration exists for the headless version, even it does not do anything.
Thanks for the help.
Best
Robert -
Accepted Answer
I've just managed to install VirtualBox on my ClearOS 6.4 machine. The steps in the earlier howto didn't work for me and I had to incorporate info from this thread and a number of other sources.
So here's the definitive list of steps, starting from a clean, brand new 6.4 installation :
yum install SDL kernel-devel kernel-headers dkms
yum install gcc
yum-config-manager --enable clearos-core clearos-developer
yum --enablerepo=clearos-core,clearos-developer,clearos-epel install clearos-devel
Then :
uname -r
ls /usr/src/kernels
If the output of the last 2 commands is different :
cd /usr/src/kernels/
ln -s <insert your kernel kernel version - in my case 2.6.32-220.23.1.el6.x86_64> `uname -r`
Then :
cd /etc/yum.repos.d
yum install wget
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
yum search VirtualBox
The last command will list the available versions. Mine listed the following :
VirtualBox-3.2.x86_64 : Oracle VM VirtualBox
VirtualBox-4.0.x86_64 : Oracle VM VirtualBox
VirtualBox-4.1.x86_64 : Oracle VM VirtualBox
VirtualBox-4.2.x86_64 : Oracle VM VirtualBox
yum install VirtualBox-4.2
/etc/init.d/vboxdrv setup
Next, download Oracle_VM_VirtualBox_Extension_Pack-4.2.18-88780.vbox-extpack from http://www.virtualbox.org/wiki/Downloads and copy it to your ClearOS machine.
Then :
/usr/bin/VBoxManage extpack install ./Oracle_VM_VirtualBox_Extension_Pack-4.2.18-88780.vbox-extpack
Now you're ready to create a VM. I installed Windows 7 Home Premium 32-bit. The commands below will create a Windows 7 machine with 1.5GB of RAM and a 20GB hard drive. In my case eth1 is the LAN NIC on my server.
Note that in the modifyvm command below, the "--nictype1 82540EM" is needed for Vista and later versions of Windows as they phased out support for VirtualBox's default network adapter type, but not for XP and earlier.
VBoxManage createvm --name "Win7" --register
VBoxManage modifyvm "Win7" --memory 1536 --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 eth1 --nictype1 82540EM
VBoxManage createhd --filename Win7.vdi --size 20000
VBoxManage storagectl "Win7" --name "IDE Controller" --add ide
VBoxManage storageattach "Win7" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium Win7.vdi
VBoxManage storageattach "Win7" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium <path to ISO file of windows installer>
VBoxHeadless --startvm "Win7" &
You should now be able to connect to the virtual machine using Windows Remote Desktop at the LAN address of your server and drive Windows through the setup process. When that's finished, shut down the VM and attach the guest additions ISO as follows. Without these, your display and mouse (at the very least) won't work well.
VBoxManage modifyvm "Win7" --dvd none
VBoxManage storageattach "Win7" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /usr/share/virtualbox/VBoxGuestAdditions.iso
VBoxHeadless --startvm "Win7" &
Now attach to the VM again, install the guest additions from the virtual DVD drive and shut down.
Now detach the guest additions ISO :
VBoxManage modifyvm "Win7" --dvd none
I wanted to set my VM up as a print server. Here's the steps (run these commands while the VM is shut down) :
VBoxManage modifyvm "Win7" --usb on
VBoxManage modifyvm "Win7" --usbehci on
VBoxManage list usbhost
The last command will list the USB devices connected to the ClearOS machine. The one I wanted is a Samsung 4521 printer, which was listed with vendor ID 0x04e8 and product ID 0x3419.
VBoxManage usbfilter add 1 --target "Win7" --name Samsung_4521 --vendorid 0x04e8 --productid 0x3419
Now power up the VM, install the printer driver and share it. You may need to install additional drivers if you're connecting 64-bit machines to the printer.
That's it! -
Accepted Answer
-
Accepted Answer
Not sure what else needs to be done, but i have gone through all the pages in this thread to try and get it working
This is the error i am getting:
[root@system ~]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules [ OK ]
Uninstalling old VirtualBox DKMS kernel modules [ OK ]
Trying to register the VirtualBox kernel modules using DKMSError! echo
Your kernel headers for kernel 2.6.32-279.19.1.v6.i686 cannot be found at
/lib/modules/2.6.32-279.19.1.v6.i686/build or /lib/modules/2.6.32-279.19.1.v6.i686/source.
[FAILED]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong)
[root@system ~]#
-
Accepted Answer
Hi,
I did follow all the steps with no errors. but at restart I had no visible virtualbox
I i run manually vboxmanage startvm....
then I've VRDE server is listenning on port 3389
When I enter the IP of my host on a windows RDC i've no answer.
How can i access my virtualized windows ?? Or did I miss something ?
Thanks by advance
Seb -
Accepted Answer
Thanks for all who helped. I Finally got my guest os installed and working great. Phew, what a process. But again, thanks
Im running into another issue though. I created a flexshare of files I have stored on the clearos box, and after mapping my share drives in my guest os, I opened a folder and to my surprise for some reason my unicode characters (russian characters) are appearing as under scores (______ ___ .mp3) only the tracks that have either numbers or english characters show up and work great.
For example.
If you navigate to
z:\myfiles\mytracks\10______.mp3 I get my song (10______.mp3)
But if I connect through FTP. I get
ftp://myfiles/mytracks/10песня.mp3
Seems some Unicode option needs to be selected in clear os or something. I have already enabled "Russian" in the regional language and settings on my guest os and restarted it.
Thanks -
Accepted Answer
@Nick,
Thanks for the comments, I will address those repo so they don't break anything else. You are 100% correct. I seem to have lost sight of "standard practices in Linux" being "so overwhelmed" with getting this project to work. Thanks for bringing me back...
*************************
Makc wrote:
After following post, I installed virtual box, but after i started the vm, windows xp loads all drivers during its setup, and then setip gets stuck on "setup is starting windows"
What could that be? I have tried multuple iso's
Thx
@Makc
Assuming that everything is working on the host, it will be in your guest's settings. My first thought is that it might have to do with ioacpi. Try turning ioacpi off and see if it makes a difference. Here's the command, change "vmname" to your guest's name.
VBoxManage modifyvm "vmname" --ioacpi off
On my first attempt, my vm (windows 7 64) would start loading windows and just reboot. After some more tweeking to the guest, another attempt said that Windows 7 could not load because it was not a 64 bit environment (even though my host hardware meets all the requirements). I also had to change the guest network adapter type (once it actually booted up) so that my guest could find a network driver. They seem to have changed quite a few things in VirtualBox as far as the guest machine parameters. You will probably need to tinker with a few of the guest machine settings to figure out what will work for yours.
Below is the VirtualBox Forum site. Research some of the guest parameters there and try them out. Worst case, you may need to "re-create" your vm a few times. There are quite a few discussions concerning 32bit vs 64bit using: apic, ioapic, PAE/NX, etc. Most of the posts refer to "using the GIU" to change guest settings but since your's is headless, the "VBoxManage modifyvm" command is probably going to be your best friend.
virtualbox forums
Hopefully that gives you a starting place... -
Accepted Answer
-
Accepted Answer
Good write up. Thanks.
A couple of comments. "Development Tools" no longer exist in 6.2 which is why you had to do the line after. The alternative is here
If you are enabling repos generally disabled or adding external repos it is best to leave them disabled and then selectively enable them when required. So, when you enabled clearos-epel you may be better advised to add the "--enable-repo clearos-epel" to your yum commands. You may also want to change the "enabled=1" to "enabled=0" in virtualbox-repo and only selectively enable it. Then when you do an "yum install virtualbox" you enable both the clearos-devel and virtualbox repos. it *may* get round your dkms issue. -
Accepted Answer
Here is my write-up, hopefully it helps out. If you can make this into a script, that would be awesome <hint hint>
I finally got this to work with ClearOS 6.2 and VirtualBox 4.1 running Windows 7 64 bit as the guest OS. Had a few challenges (including the kernel-devel and kernel-headers). I did not install the web interface for virtualbox, I found I did not need it for my particular install. There are probably some things that can be done easier, please comment when you see them. Thank you everyone for your posts, they helped to find answers to the issues. If you try this out, please remember post your findings as well, it may help the next person...
I will mention one big lesson I learned the hard way, DO NOT do a “yum update” before you register your ClearOS system. It trips something that AUTO-UPGRADES you to the professional version and ELIMINATES THE OPTION OF COMMUNITY VERSION. I had to reload from scratch to register it properly as a community version. The good news is, because of this lesson, I was able to verify that the steps worked for me on the second time too!
Here are the steps. I did everything using: SSH, Firefox and rdesktop on an Ubuntu box.
First, REGISTER YOUR SYSTEM, then get to the command line.
The following steps will update your system using yum, add a virtualbox repository from oracle to your system and install all the other misc stuff you'll need.
##update the system. If you haven't registered your system, do it before doing this update if you want to run the community version (last reminder, I promise).
yum update -y
We need to change directories to where the repository files are stored . We are going to download a new repository here so yum will “automagically” find it the next time you update.
cd /etc/yum.repos.d/
Install wget so you can download the file for the new repository
yum install wget -y
Download the repository file from virtualbox.
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
Change driectories back to the root directory so nothing else gets downloaded here by accident.
cd /root
Now that you have a new repository, it will need to be checked and updated.
yum update -y
Get some dependencies
yum groupinstall "Development Tools" -y
yum install php-soap gcc dkms kernel-devel -y
This command came from Tim in another thread but seems to help virtualbox compile correctly because it uses the v6 kernel-headers as opposed the the el6 kernel-headers in the standard repository. See the thread for details... http://www.clearfoundation.com/component/option,com_kunena/Itemid,232/catid,37/func,view/id,40819/
yum --enablerepo=clearos-dev install kernel-devel-`uname -r` kernel-headers-`uname -r`
Create a vbox system user with a home directory
/usr/sbin/useradd -r -m vbox
Create group and add vbox to it
/usr/sbin/usermod -a -G vboxusers vbox
Install VirtualBox 4.1 using yum virtualbox.org repository
yum install VirtualBox-4.1.x86_64 -y
Now, this is the part that I forgot about BOTH times. I got errors with virtualbox, as noted in the posts previous to this one. Even though the command to install dkms is listed above (and I thought that it did install), virtualbox has issues with it. To fix it, I enabled the “clearos-epel” repository using the web GUI under “System” tab, “Software Repository”. With the new repo, you;ll need another update:
yum update -y
Now you will need to install dkms (again?)
yum install dkms -y
Recompile virtualbox drivers with the new dkms. The recompile didn't have any errors this time.
/etc/init.d/vboxdrv setup
Also, in 4.1, there is an expansion pack that adds functionality into the machine like RDP. You will neeed to download it from virtualbox.org and install it. Go to the website https://www.virtualbox.org/wiki/Downloads look up the extension pack and update the address below to match your version. Here is the link for the one I used:
wget http://download.virtualbox.org/virtualbox/4.1.16/Oracle_VM_VirtualBox_Extension_Pack-4.1.16-78094.vbox-extpack
Use vboxmanage to install it.
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.16-78094.vbox-extpack
So now I had it set up, I needed a machine. Here goes....
First of all, create a new system user called vbox and a group for them.
/usr/sbin/useradd -r -m vbox
/usr/sbin/usermod -a -G vboxusers vbox
I needed a Windows 7 iso file to load this thing so I converted the installation CD to an iso. Put the CD into your ClearOS machine. Don't worry, it doesn't really catch on fire when the “essence of pure evil” touches your machine. It may smolder though.. Anyway, here's the command to convert the CD to an ISO:
dd if=/dev/cdrom of=/home/vbox/windows7.iso
Change directories to where it was created and then change the ownership to vbox to avoid “issues”
cd /home/vbox/
chown vbox:vbox /home/vbox/windows7.iso
You now need to change your user to vbox instead of root, so the rest of these commands are as the user vbox.
su vbox
virtualbox creates it's working directory with a space in the name. Spaces can cause you some headaches if they are not escaped. Make a new working directory and and configure virtualbox to use it as the working directory to store virtual machines.
Mkdir /home/vbox/vms
VBoxManage setproperty machinefolder /home/vbox/vms/
Create and register your new virtual machine. The new machine will be stored in the directory you just created.
VBoxManage createvm --name "Windows7" –register
This one modifies the new vm and creates a lot of hardware. I set it with 2 gig of ram (2048) since it's not going to be really used heavily, just occasionally for remote access for a Windows user.
First issue I had was it would not run saying something about not 64 bit. AMD FX 4-core “Unlocked” processor and seems to meet all the specs. Wound up being the “ioacpi” setting, it needed to be turned on.
I also had some issues with Windows finding the nic driver at first too so I changed the nictype. There are a few different ones, this one seemed to work so...
I tried using both bridged and nat connections. Ultimately, I didn't need a bridged network on this device so nat worked fine.
Here is the initial command with all the stuff that made mine work:
VBoxManage modifyvm "Windows7" --memory 2048 --cpus 1 --ioacpi on --acpi on --boot1 dvd --nic1 nat --nictype1 82545EM --ostype "Windows7_64"
This will create a 40 gig drive for your machine. If you want bigger, just change the 40960 to something higher. (multiples of 1024)
VBoxManage createhd --filename "HDD-Windows7.vdi" --size 40960 --remember
Now add a controller fot the hard drive
VBoxManage storagectl "Windows7" --name "storage-ctrl" --add sata
Attach the new hard drive to the machine
VBoxManage storageattach "Windows7" --storagectl "storage-ctrl" --port 0 --device 0 --type hdd --medium /home/vbox/vms/Windows7/HDD-Windows7.vdi
This changed the RPD port to 3389.
VBoxManage modifyvm "Windows7" --vrde on --vrdeport 3389
Add the iso file to the machine as it's CDROM
[codeVBoxManage storageattach "Windows7" --storagectl "storage-ctrl" --port 1 --device 0 --type dvddrive --medium /home/vbox/]windows7.iso[/code]
This starts up the machine. Once it's started, use remote desktop or rdesktop to connect by pluggin in your clearos ip followed by the port. Example on Ubuntu: rdesktop 192.168.1.1:3389 and now install Windows 7 from the CD you attached using your RDP session.
VBoxHeadless --startvm "Windows7" -vrde on -vrdeproperty TCP/Ports=3389 &
FINALLY, setup autostart. You will want to be root on this one. Type exit if you are still using the vbox user and you should be root again. You will need to add in the following line to the end of /etc/rc.d/rc.local. I used nano: Copy and paste the following at the bottom:
/bin/su -l vbox -c '/usr/bin/VBoxHeadless --startvm Windows7 2>&1 &'
Press CTRL + o to save and CTRL + x to exit when you are done.
Nano /etc/rc.d/rc.local
If all went well, when you restart your ClearOS system, the virtual machine will startup automagically as well. If the virtual machine is running whenyou want ot reboot, it is probably a good idea to log into it and shut it down before initiating a reboot. I have “LogMeIn” installed in the Windows 7 machine and it comes on-line a few minutes after the server boots up. At this point, the RDP session is pretty much just to check progress if it fails to show “on line” in LogMeIn.
That's about it. If you find a better way, please post it. Thanks again for all the other posts that got it working. -
Accepted Answer
I had the same problem, it is a hitch between the 220.13 and 220.17 kernel.
This solved the problem for me, quite posible not all thins is nessesary for you, since I messed it up quite a bit first.
Will do a fresh install to check the right method.
1. yum remove kernel-devel
2. yum remove kernel-headers
3. yum remove kernel-2.6.32-220.13.1.v6.x86_64 (Think this wil do it)
4. yum update
5. yum --enablerepo=* install kernel-devel
5. yum --enablerepo=* install dkms
6. cd /lib/modules/`uname -r`
7. ls -l (The build is read since the kernel have once again changed. :-)
8. rm -vf build
9. ln -s /usr/src/kernels/2.6.32-220.17.1.v6.x86_64 build
10. /etc/init.d/vboxdrv setup
I had to install the extension pack once again to get the vrde -remote desktop to work again
Should not, maybe I have reinstaled the vbox to try to get it running. :-)
11. VBoxManage extpack install /path/th/your/extension/pach/Oracle_VM_VirtualBox_Extension_Pack-4.1.16-78094.vbox-extpack
12. su vobx (the vbox users you have made)
13. VBoxHeadless --startvm Win7 & (Change Win7 to your virtual os)
Working. :-) -
Accepted Answer
I had the same issue with dkms, I enabled the “clearos-epel” repository using the web GUI under “System” tab, “Software Repository”.
Then I went back to the command line, did a "yum update" and "yum install dkms". After that, I did the /etc/init.d/vboxdrv setup and it recompiled without any errors. I will do a write up on all the steps I did this evening, I just got it working perfectly! -
Accepted Answer
Now, i already completed all the steps (I installed the newest version 4.1.16), and when i run either vboxwebserver or usr/bin/vboxwebsrv, i get the following:
Oracle VM VirtualBox web service version 4.1.16
(C) 2005-2012 Oracle Corporation
All rights reserved.
VirtualBox web service 4.1.16 r78094 linux.x86 (May 22 2012 17:19:45) release lo g
00:00:00.000 main Log opened 2012-05-23T03:07:22.341025000Z
00:00:00.000 main OS Product: Linux
00:00:00.000 main OS Release: 2.6.32-220.17.1.el6.i686
00:00:00.000 main OS Version: #1 SMP Tue May 15 17:45:22 MDT 2012
00:00:00.000 main OS Service Pack: #1 SMP Tue May 15 17:45:22 MDT 2012
00:00:00.000 main Executable: /usr/lib/virtualbox/vboxwebsrv
00:00:00.000 main Process ID: 31529
00:00:00.000 main Package type: LINUX_32BITS_RHEL_6
00:00:00.189 SQPmp Socket connection successful: host = default (localhost), port = 18083, master socket = 8
If i close the ssh shell, or if i just do ctrl+C, what will happen? Vritualbox will stop running? If so, should I install something like Screen or something to keep that running?
Thanks in advance!
EDIT 2:
Now, I restarted my server, and when I try to run vboxwebserver (or /usr/bin/vboxwebsrv), i get the following:
[root@gateway ~]# /usr/bin/vboxwebsrv
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (2.6.32-220.17.1.v6.i686) or it failed to
load. Please recompile the kernel module and install it by
sudo /etc/init.d/vboxdrv setup
You will not be able to start VMs until this problem is fixed.
Oracle VM VirtualBox web service version 4.1.16
If I run: sudo /etc/init.d/vboxdrv setup as it says there, i get the follwing:
[root@gateway ~]# sudo /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules [ OK ]
Uninstalling old VirtualBox DKMS kernel modules [ OK ]
Trying to register the VirtualBox kernel modules using DKMS[FAILED]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong
Then I checked the vbox-install.log and I found the error to be:
Makefile:172: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.
Then I run: export KERN_DIR=/usr/src/kernels/2.6.32-220.17.1....
and finally run /etc/init.d/vboxdrv setup again, and now it says the following:
[root@gateway ~]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules [ OK ]
Uninstalling old VirtualBox DKMS kernel modules [ OK ]
Removing old VirtualBox pci kernel module [ OK ]
Removing old VirtualBox netadp kernel module [ OK ]
Removing old VirtualBox netflt kernel module [ OK ]
Removing old VirtualBox kernel module [ OK ]
Trying to register the VirtualBox kernel modules using DKMS[FAILED]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [ OK ]
Starting VirtualBox kernel modules [FAILED]
(modprobe vboxnetflt failed. Please use 'dmesg' to find out why)
When I run dmesg, hundreds of lines of errors appears.
EDIT 3:
Regarding to the phpvirtualbox. I created an user (vbox), asigned a usergroup (the one that says on the first page of this thread), and created a password to It.
But when i try to login to phpvirtualbox, i receive the following error:
Error logging in to vboxwebsrv.
Details:
Exception Object
(
[messagerotected] => Error logging in to vboxwebsrv.
[string:Exceptionrivate] =>
[coderotected] => 64
[filerotected] => /var/www/html/vbox/lib/vboxconnector.php
[linerotected] => 188
[trace:Exceptionrivate] => Array
(
[0] => Array
(
[file] => /var/www/html/vbox/lib/auth/Builtin.php
[line] => 45
[function] => connect
[class] => vboxconnector
[type] => ->
[args] => Array
(
)
)
[1] => Array
(
[file] => /var/www/html/vbox/lib/ajax.php
[line] => 119
[function] => login
[class] => phpvbAuthBuiltin
[type] => ->
[args] => Array
(
[0] => vbox
[1] => ""vbox password"
)
)
)
[previous:Exceptionrivate] =>
) -
Accepted Answer
Mariano wrote:
sorry for the extremely stupid question that that im gonna ask, that was somehow answered 2 posts ago:
Im currently Running COS 6.2 Community. And I would like to have a CentOS Guest OS virtualized, fully dedicated to downloads.
Which script should I run / install to install Virtual Box on my COS 6.2 box? The script on the first post of this thread?
Thank you very much in advance!
I didn't use any of the scripts.
First do run "cat /proc/sys/kernel/osrelease" and you should see your kernel version. Mine is "2.6.32-220.17.1.v6.x86_64" so then I ran
yum install kernel-devel-2.6.32-220.17.1.v6.x86_64.
yum install glibc-common.x86_64 compat-glibc.x86_64 glibc.x86_64 glibc-devel.x86_64 glibc-headers.x86_64 glibc-static.x86_64 glibc-utils.x86_64
yum install kernel-devel gcc-c++
Wget is not installed by default, so install that;
yum -y install wget.x86_64
Needed to add a couple of repositories:
rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm -i rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
Then download Virtualbox:
wget http://download.virtualbox.org/virtualbox/4.1.14/VirtualBox-4.1-4.1.14_77440_rhel6-1.x86_64.rpm
yum localinstall VirtualBox-4.1-4.1.14_77440_rhel6-1.x86_64.rpm
export KERN_DIR=/usr/src/kernels/2.6.32-220.17.1.v6.x86_64/
Then finally I ran:
/etc/init.d/vboxdrv setup
For phpvirtualbox:
yum -y install php-soap.x86_64
yum -y install unzip
cd /var/www/html
wget http://phpvirtualbox.googlecode.com/files/phpvirtualbox-4.1-7.zip
unzip phpvirtualbox-4.1-7.zip
Here is where the vboxwevsev just will not run, and still have not had time to determine the cause. I just run "/usr/bin/vboxwebsrv" at the command line through webmin and it works, phpvirtualbox that is. Be sure to follow the instructions about creating the vbox user and groups and giving that user account a password. -
Accepted Answer
sorry for the extremely stupid question that that im gonna ask, that was somehow answered 2 posts ago:
Im currently Running COS 6.2 Community. And I would like to have a CentOS Guest OS virtualized, fully dedicated to downloads.
Which script should I run / install to install Virtual Box on my COS 6.2 box? The script on the first post of this thread?
Thank you very much in advance! -
Accepted Answer
This kernel-header and kernel-devel problem has been mentioned in a number of threads but it has not been picked up by the devs, so I have raised bug 615 to hopefully get it sorted once and for all. -
Accepted Answer
dustin wrote:
Has anyone installed vbox on 6.2? Should the install script provided earlier in the thread work for 6.2? Sorry if it should be obvious, my linux knowledge is still limited.
Yes, just got it installed today along with phpvirtualbox. One problem I have not resolved is the vboxweb-service does not function properly. I can not use the init.d service, however if I simply run the command "/usr/bin/vboxwebsrv" it starts. Have not had time to resolve this, however I did get virtualbox working and did start the install of several VMs.
One problem I did encounter, when I used yum to install kernel-headers what I got was "2.6.32-220.13.1.el6.x86_64" yet my kernel is in fact "2.6.32-220.13.1.v6.x86_64". So I then used yum to download the specific headers I needed and vbox was able to re-compile after initial install did not compile the modules. For that I ran /etc/init.d/vbox setup which re-compiled them after they were installed (if you have the correct headers already present this probably won't be necessary).
When I have time I will post back if I get this websrv issue resolved to see if it is isolated to my *$&@ install or maybe common to 6.2 -
Accepted Answer
-
Accepted Answer
-
Accepted Answer
I'm not in a hurry right now and it is good to know the workaround. As far as I'm aware of, I'm running this kernel already for months (assumed that my kernel is NOT affected by any yum upgrade, but I did not check this).
What is holding up the horses to provide the dev-set ? Other priorities maybe ?
Would be pleased to see it it resolved -
Accepted Answer
Same theme as my post from a few days ago. The devs updated the kernel a few days ago but they did not release the kernel-headers or kernel-devel for this updated kernel. They really need to do that. If you can't wait until then, you should still have the 2.6.18-194.8.1.v5 PAE kernel installed so you can just remove the 2.6.18-308.1.1.v5PAE kernel and reboot or reboot and when you get the option select the old kernel to boot from. -
Accepted Answer
-
Accepted Answer
After a Yum upgrade my headless Vbox is not running anymore. My Vbox 4.1.10 was extremly stable before.
Started to read and came to the following steps:
- Upgrade to 4.1.12 via
yum localinstall VirtualBox-4.1-4.1.12_77245_rhel5-1.i386.rpm
VBoxManage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-4.1.12-77245.vbox-extpack
But run in the following issue -> Trying to register the VirtualBox kernel modules using DKMS[FAILED]
[root@system install]# uname -mr
2.6.18-308.1.1.v5PAE i686
[root@system install]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules [ OK ]
Uninstalling old VirtualBox DKMS kernel modules [ OK ]
Trying to register the VirtualBox kernel modules using DKMS[FAILED]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong) -> Makefile:172: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.
Does anyone had the same issue so far and what was your solution ?
Thanks in advance -
Accepted Answer
-
Accepted Answer
-
Accepted Answer
-
Accepted Answer
-
Accepted Answer
I upgraded to 4.1.8 on my clearos 5.2 up-to-date system. Works without any problem. Don't forget to install Oracle_VM_VirtualBox_Extension_Pack-4.1.8-75467.vbox-extpack to enable RDP services for headless operations.
Still a question which maybe is resolved by someone. I'm running some headless XP machines and want to add an headless OSX 10.7 to it also. Everything is working with OSX 10.7 on my Clearos 5.2 host, except for the USB mouse. It is working but I have 2 cursors which of course are related to each other but not one. For Windows guest there is a Guest Additions to be installed to resolve audio, video and USB issues. Such an extension does not exists for OSX platforms. This complete setup is headless and the RDP sessions are running in a Windows environment.
Is there a solution to get this mouse acting directly when using a headless setup ? -
Accepted Answer
I am unsure whether I have read this on this same topic or on another site, but I have been using VBoxTool to autostart VMs and never had a problem with it.
It's easy to configure and also a good tool to manage a headless server if you do not want to install phpVirtualBox.
http://vboxtool.sourceforge.net/ -
Accepted Answer
This setup here provides a nice way of auto starting and stopping your vm's at boot time.
http://www.kernelhardware.org/virtualbox-auto-start-vm-centos-fedora-redhat/
you need to edit the script to reflect your user and password and I had to change a line from
$SU "$VBOXMANAGE controlvm "$VM" acpipowerbutton"
to
$SU "$VBOXMANAGE controlvm "${VM%% *}" acpipowerbutton"
You also need to make your script executable and make sure there are no white spaces in /etc/virtualbox/machines_enabled. -
Accepted Answer
Thanks Fernando. I'm glad to hear that my script works for other's especially since it was built with business use in-mind.
I'm in the process of turning my Client's Full out servers and replacing them with ClearOS Replacing not only the server but their router too.
This being Said I've not had an bridging issues on the internal nic card.
Can you please explain the setup you have i will help as much as i can. -
Accepted Answer
Thanks for the awesome script to install VirtualBox and phpVirtualBox - it worked perfectly on a new install of 5.2. I am having some issues, though. I want to run a few VMs and have them bridged to the internal interface while ClearOS is the host and is running in gateway mode. Bridging to the external interface works, but bridging to the internal interface doesn't. Anyone done this or know how I can get this working?
Thanks. -
Accepted Answer
-
Accepted Answer
Running ClearOS as a client inside a VirtualBox (tested also with Centos + Ubuntu + BLAG VirtualBox clients on Centos 5 + ClearOS 5.x hosts) I experienced the following symptoms. (both with hostonly and NAT adapters)
- Slow http(s) browser access to the ClearOS (VirtualBox) machine
- Failure to load web pages (even :81 and :83) for Windows XP clients and Vista clients (but not Linux?!) on Firefox, IE and chrome. Timeout or very slow for W7 30s to load Web Admin / Horde. Zarafa mail came up with zarafa layout css and logos but a blank screen inside.
- openVPN connection instability
It has turned out the problem is due to the default tx/rx offload setting for the adapter within the VM slowing tx and rx traffic through the vboxnet0 interface.
TESTS
Create a sizable file on the host and scp it to the VBox:
[vboxuser@devcos tmp]$ scp 500mbfile root@192.168.56.51:/tmp/500mbfile
100% 558MB 5.9MB/s 01:34
[vboxuser@devcos tmp]$ scp root@192.168.56.51:/tmp/500mbfile 500mbfile
0% 528KB 28.4KB/s 5:35:21 (i had to ctrl-break this one!)
As you can see bandwidth for the rx from the ClearOS was terrible
ssh into the VBox and run these commands from inside
To check the current setting:
ssh root@192.168.56.51
root@COS:# ethtool -k eth0
Offload parameters for eth0:
rx-checksumming: on
tx-checksumming: on
scatter-gather: on
tcp-segmentation-offload: on
udp-fragmentation-offload: off
generic-segmentation-offload: on
generic-receive-offload: off
large-receive-offload: off
THE FIX
root@COS:# ethtool -K eth0 tx off
root@COS:# ethtool -K eth0 rx off
Check the new settings:
root@COS:# ethtool -k eth0
Offload parameters for eth0:
rx-checksumming: off
tx-checksumming: off
scatter-gather: off
tcp-segmentation-offload: off
udp-fragmentation-offload: off
generic-segmentation-offload: on
generic-receive-offload: off
large-receive-offload: off
And test the results:
[vboxuser@devcos tmp]$ scp root@192.168.56.51:/tmp/500mbfile 500mbfile
100% 558MB 7.3MB/s 01:16
[vboxuser@devcos tmp]$ scp 500mbfile root@192.168.56.51:/tmp/500mbfile
100% 558MB 8.3MB/s 01:07
This is a test server so IO is slow but on the production server (Centos 5 x64bit) is giving between 15MB/s (rx) and 56MB/s (tx) throughput.
NOW FOR THE WIERD BIT
If I use ethtool -k to turn the offload back ON, the results do not change from when I turned it OFF. However rebooting the VM brings back the same low tx speeds..
Now, to make it stick on reboot.. any ideas? -
Accepted Answer
Robert,
I have tried your script and have problem log in in.
I get following:
Exception Object
(
[messagerotected] => Error logging in to vboxwebsrv.
[stringrivate] =>
[coderotected] => 64
[filerotected] => /var/www/html/vbox/lib/vboxconnector.php
[linerotected] => 108
[tracerivate] => Array
(
[0] => Array
(
[file] => /var/www/html/vbox/lib/vboxconnector.php
[line] => 239
[function] => __vboxwebsrvConnect
[class] => vboxconnector
[type] => ->
[args] => Array
(
)
)
[1] => Array
(
[file] => /var/www/html/vbox/lib/auth/Builtin.php
[line] => 21
[function] => connect
[class] => vboxconnector
[type] => ->
[args] => Array
(
)
)
[2] => Array
(
[file] => /var/www/html/vbox/lib/ajax.php
[line] => 108
[function] => login
[class] => phpvbAuthBuiltin
[type] => ->
[args] => Array
(
[0] => admin
[1] => admin
)
)
)
)
Any idea why or how I would resolve it? -
Accepted Answer
look to line 22 - 25 of my script I'm guessing the RDP extension is not installed or maybe not installed correctly.
if it's not that then maybe a php version issue with you phpvirtualbox i've ran into that but the version downloaded in my script takes care of that issue you also need to make sure your trying to rdp vbox server ip/hostname not the guest os ip/hostname
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »