Virtualbox
reinstall virtualbox
I start with reinstall because it means remove and install and install is the next chapter.
Some of the symptoms that were solved by this :
(VirtualBox program) Kernel driver not installed (rc=-1908)
(/var/log/vbox*) Building the PCI pass-through module. Error building the module:
(/var/log/vbox*) make: *** No rule to make target 'install'. Stop.
Whenever you have any problems installing virtualbox it is wise to just remove any remainders and then do a new installation.
| clean install | |
|---|---|
Last time on re-installation i got messages like this :
| error | |
|---|---|
This suggest you can also make a command that removes all these icons, an attempt:
However the installer messages are warnings so you could just as well ignore them, there only might be a few too many icons afterwards.
Now proceed to installing :
install virtualbox
Only install the "All distributions" version, it has a 100% success rate.
You can find it here : https://www.virtualbox.org/wiki/Linux_Downloads
It is a script containing binary data so you can wget a particular version with
| install virtualbox | |
|---|---|
pxeboot
So VirtualBox can act as PXE and TFTP server to the virtual hosts on the NAT network. It cost me days to find the actual statement but :
Virtualbox has an embedded tftp server !!!
I found it in the small print here : https://www.virtualbox.org/manual/ch09.html (chapter 9.11.2)
It operates on address 10.0.2.4 !!!
Setting up seems straightforward, but none of the tutorials worked out of the box. So here is an example of a setup with notes on how to find out what's wrong, the chapters are based on all the problems encountered.
copy the files
The setup for a tftp server would be something like /tftpboot, for Virtualbox another location had to be found to not bite the server's tftpboot setup, so it is :
| tftp | |
|---|---|
Or.. at least a TFTP directory in the file where your VirtualBox.xml is located. On Mac OSX this is that directory. The tutorials i found did not include all files needed. So let's get the base packages needed which are :
The last two are not in any tutorial but copy them anyway, the exact directories :
| directories | |
|---|---|
A distribution, let's use centos6.7 see : https://docs.google.com/document/d/1LiGH75T45XNt_1p94Mhw57btYN-1IEfK5W0e8FLPwxw/edit) for a guide on how to mount the ISO file.
| copy | |
|---|---|
Also we "need" a menu file : it is called TFTP/pxelinux.cfg/default a version with and without kickstart :
So... let's get on with a kickstart file as well : it is called ks.cfg
| ks.cfg | |
|---|---|
Just a start-off version , it will probably be heavily altered for ansible use.
However, this cannot be put in the TFTP directory since redhat only supports providing the kickstart file via http: so we need to enable apache on localhost and put the kickstart file in
sudo cp ks.cfg /Library/Webserver/Documents
To be able to reach it at http://10.0.2.2/ks.cfg Since that is localhost from the VirtualBox NAT viewpoint.
virtualbox settings
Some troubleshooting tips, you can alter the image and tftp address with commands like :
| change tftpserver | |
|---|---|
But there is no way to view the current settings, however you can see those values in the file :
| view settings | |
|---|---|
And the previous version ends in vbox-prev, handy if you know it.
Troubleshooting virtualbox
vboxadd
If you wonder what service this is on a VM machine, its VirtualBOX guest ADDitions.
qemu permission denied
symptom
2015-01-28T13:48:55.492767Z qemu-kvm: -drive file=/root/CentOS-6.6-x86_64-minimal.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw: could not open disk image /root/CentOS-6.6-x86_64-minimal.iso: Permission denied
When running virt-install for kvm-qemu.
cause
The image file for centos was in /root, and qemu is the one running the command eventually even if you started virt-install as root !! qemu can't read the file from /root
cure
Put the image in /tmp, qemu can read it from there. --cdrom=/tmp/Centos....iso
VERR_SUPLIB_OWNER_NOT_ROOT
symptom
Failed to open a session for the virtual machine xxxxx Failed to load VMMR0.r0 (VERR_SUPLIB_OWNER_NOT_ROOT).
And the details :
Result Code: NS_ERROR_FAILURE (0x80004005) Component: Console Interface: IConsole {1968b7d3-e3bf-4ceb-99e0-cb7c913317bb}
Also if you examine the logs in ~/VirtualBox VMs/vm/Logs, you will find the line :
The owner is not root: '/usr
cause
In my case, this was cause by an installation of libflashplayer from a download. By the way do not do that, add 'contrib' to your sources.list and
| flash plugin | |
|---|---|
I untarred the tar.gz file in the root which is a big nono. It unpacks files with user number 501, not root, which fucks up a lot of things. * do not fix this by chown -R root.root that will completely fuck up your system. Fix it by resetting directories to root.root, starting with /usr
cure
In my case the two directories above where enough, but you could see in the tar.gz files that ruined it which files and directories should be reset, or by monitoring ~/VirtualBox VMs/vm/Logs .
vboxdrv setup
symptom
After every reboot, virtualbox complains about having to run :
| always needed | |
|---|---|
And it will work fine bu t be forgotten after next reboot.
cause
It is actually a bad error message, since it just means the vboxdrv is not loaded .
cure
Simply add a line :
| add to /etc/modules | |
|---|---|
To /etc/modules ... done!
usb support
This will not work out of the box, you have to go to the oracle site and install a special extension pack.
- Install extension pack
- add yourself to the group vboxusers !!
- logout and login again or the group change won't stick
- start virtualbox and enable USB,try adding some usb devices there
Failed to mount folders in Linux guest
Failed to mount folders in Linux guest. This is usually because the "vboxsf" file system is not available. Please verify that the guest additions are properly installed in the guest and can work properly. The command attempted was:
| mount guest folders | |
|---|---|
The error output from the last command was:
| error | |
|---|---|
This error is usually because of a mismatch between Virtualbox and the guest additions. Always have the same version of both. This is easily done by just following all suggestions from virtualbox after you installed a new version. It will include the new vbox guest additions iso as well.
It will possibly require you to reinstall (destroy .. up ) a vagrant box that has a mismatch.
Install guest additions on debian
- Login as root;
- Update your APT database with apt-get update;
- Install the latest security updates with apt-get upgrade;
- Install required packages with apt-get install build-essential module-assistant;
- Configure your system for building kernel modules by running m-a prepare;
- Click on Install Guest Additions... from the Devices menu, then run mount /media/cdrom.
- Run sh /media/cdrom/VBoxLinuxAdditions.run, and follow the instructions on screen.
Guest Log: int13_harddisk: function 02, unmapped device for ELDL=8f
When trying to startup virtualbox machine. In this particular case i created the machine from the commandline with VBoxManage commands and the defaults turn out to give a memory of 128 MB. Changing that to 1024 MB did work for me.
| error | |
|---|---|
When receiving this error, you probably did not enable virtualization support in the bios.
You can test it with :
virt-resize : unsupported feature(s) : 64 bit
The error appeared after using virt-resize :
| error | |
|---|---|
This happened while i was resizing a centos7 VM disk image on a centos 6 hypervisor. It is the e2fsck from centos 6 that is used to resize a newer EXT4 filesystem, so you just should not do that. At least run the commands on a centos 7 host if you have to, otherwise match the versions. confirmed : after using same version OS's (centos6) this worked without error.
osx virtualbox
All my vagrant attempts failed with either a black screen or guru meditation. So i tried this site : https://www.youtube.com/watch?v=_cPlKqp8nEA since i know i had an install like this working last time.
The first attempt at my intel machine with vagrant worked, so this does seem to be an AMD issue.
Note that a black screen could be cause by the wrong chipset in :
System->Motherboard->chipset. (last time i set it to PIIX3) choose either one to test if that works better.
Working vagrant setup
CPU : Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
with vagrantfile :
| Vagrantfile | |
|---|---|
This one does NOT work on hoek, screen remains black and you cannot 'vagrant ssh'
Installing problems
Mainly this error when starting any box :
And if /sbin/vboxconfig does not help, watch the error that is printed. If it is about the kernel headers you can install those with :
| install correct headers | |
|---|---|
And if even that does not work, for instance because it cannot find the exact header files for your kernel. Try this
| reinstall | |
|---|---|
What versions ?
First detecting what versions it is talking about, which is easy for virtualbox (click help->about). In my case it was :
| version | |
|---|---|
Now for the kernel modules that it is complaining about, first find the names with lsmod :
| lsmod | |
|---|---|
So any of these will do :
Neat, it is definitely not the same, and also it states where it is located. I think this module came from the backports repository i installed earlier. First i added this repository for various backport packages :
| add backports | |
|---|---|
But when doing this advise from the virtualbox site itself it advises to install this repository :
| add contrib | |
|---|---|
Both have a (different) VirtualBox packages and clearly modules present.
Now if you search the system for vboxdrv.ko, you will get some flavours:
So the one we need does not even exist, we could first just remove the drivers with :
But we still need the correct driver.
Cleanup
| cleanup | |
|---|---|
The crux of this all seems to be that running the install command as root is not enough. You HAVE to use sudo !!!
| use sudo | |
|---|---|
alter resolution OSX
For the osx box installed with vagrant, the resolution was very small. So here is a way to enlarge it with VBoxManage.
First you have to stop the VM, or it won't work, then find the id to use. :
| list vms | |
|---|---|
You can copy paste the complete name with quotes for the following command :
| setextradata | |
|---|---|
Note that the number stand for a certain resolution :
number resolution
0 640x480 1 800x600 2 1024x768 3 1280x1024 4 1440x900 5 1900x1200
On my screen 5 still fits.
osx sierra images fails above 4 GB of ram
This happens with this vagrant box on servert :
| Vagrantfile | |
|---|---|
Changing the memory to 3072 works. Actually i found some threads about this and the suggestion there was that this only happens when you have Chipset set to ICH9. Changing it to PIIX3 make this bug disappear.
| PIIX3 | |
|---|---|
I set it to PIIX3 and the memory tp 20GB and everything runs fine !!
curl3 curl4 mismatch
The last upgrade for python (3.5=>3.6) messed up my system :
- many packages got uninstalled, vagrant for instance
- apache2 and virtualbox got in a fight over libcurl3(vbox) vs libcurl4(apache)
- an uninstallable mode
I managed to get out of it by using the next two commands :
Just issue these two a lot, they will reduce the problems reported at least. But in general i could only get or apache2 to work or virtualbox. The way out of this was suggested somewhere on a vbox forum to not install the debian package but the last link on this download list:
https://www.virtualbox.org/wiki/Linux_Downloads
The "all distributions", also this was my first 6.0 install, here is the link that worked for me:
This is a shell script so :
| script | |
|---|---|
I am now in a stable system again :
Virtualbox 6 looks 'ass-tight' and i will mention here if there are reasons not to step over. It seams python stepped one version further, but the whole idea was to avoid python 3.5 because of issues.
For one : you need the latest version of vagrant (>= 2.2.3) to work with vbox 6
Resolution vbguest
Suddenly the resizing with vbguest fails to work. At least i get some info here.
One test you can do is
| test | |
|---|---|
It seems that this only lists vboxguest and vboxsf, where it should also show vboxvideo.
Whenever vboxvideo is missing something went wrong with the installation.
troubleshooting
Note that in the latest occurrence has the extra message saying you will have to sign the kernel modules if secure boot is enabled. This might set you on the wrong track.
You do NOT have to sign the kernel modules !!
Better just perform the advise that is often also printed in the error. Sometimes it is :
| modprobe | |
|---|---|
But that was very probably the command that failed so this one will have more success:
| /sbin/vboxconfig | |
|---|---|
If it does not give this output it will say what is wrong, and mostly provides the correct headers and software you need to install, so do that and try again. After this the error is normally gone.