After installing VirtualBox on my new CentOS server and using clonedvi to copy my VM’s over to the server I found a couple things not working correctly. The first thing I noticed was that I could not connect any of my USB devices to the VM’s. The USB devices showed up in the menu, but they were all grayed out. After a little research I found a forum post with the instructions I needed to set the permissions of my USB devices properly. Using instructions from the VirtualBox Forums I set up the permissions by editing the /etc/rc.sysinit like this:
if [ ! -d /proc/bus/usb ]; then
modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=501,devmode=664
mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=501,devmode=664
These lines were already present, I just added the options at the end of both lines. 501 is the group ID of the vboxusers group, of which my user is a member.
The second thing that I am having a problem with is the display of my CentOS virtual machines. I moved 2 CentOS VM’s from my laptop to the CentOS server and both exhibited the same behavior. The problem was that the desktop resolution was bigger than the VM console window. I tried resizing, maximizing and using fullscreen but just continued to see the top left corner of the VM desktop. The other thing that was happening at the same time is that the cursor position did not line up with where the mouse was, so it was difficult to even click on anything.
I found a bug report for this problem with a workaround that I can use for now. Once the VM is booted up, I have to push <host key>+F1 to switch to a console, then <host key>+F7 to switch back to the desktop. After switching back the resolution corrects itself and the mouse pointer is accurate. Alternatively, I found that I can also resolve the problem by switching to runlevel 3 and back to 5. To do this, right-click the desktop, select konsole, switch to root, type init 3 and then reverse to get back to init 5.