分类 VirtualBox 下的文章

VirtualBox Troubleshooting



1. How to change the UUID for a vdi (Disk Image) file?

[vbox@myhost HardDisks]$ VBoxManage internalcommands setvdiuuid mydisk.vdi
VirtualBox Command Line Management Interface Version 3.0.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

UUID changed to: ee32ff3a-1e86-4387-a753-a51d1528a0fe

2. How to delete eth0, eth1, eth2...?

(1) Edit /etc/udev/rules.d/rules.d/70-persistent-net.rules
delete lines, like eth0, eht1, eth2...

(2) In VirtualBox, set Network as Bridge Adapter, reset the MAC address, restart the Linux.

If you need to set the static IP address, go to /etc/network/interfces, edit the last several lines.

3. How to setup AutoStart Headless Virtual Machines in CentOS or RHEL?

Add following lines in /etc/rc.local

su vbox -c "VBoxHeadless -startvm vmachine1 -p 4000 &"
su vbox -c "VBoxHeadless -startvm vmachine2 -p 4010 &"

Remarks:
vbox: The user to start the virtual machine.
vmachine1: The name of the virtual machine.
4000: Port the VRDP server bonded to.

For more information about VBoxHeadless, please type VBoxHeadless --help.

4. How to Re-compile VirtualBox Kernel in CentOS or RHEL:

(1) When you run VirtualBox and get following errors:



(2) When you run following command, you get another error:

/etc/init.d/vboxdrv setup

[vbox@myhost ~]$ sudo /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [ OK ]
Recompiling VirtualBox kernel module [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong)

Makefile:152: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again. Stop.

(3) Solution: Please install following packages in CentOS or RHEL:

yum groupinstall "Development Tools"
yum install kernel-devel

vbox@myhost ~]$ sudo /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [ OK ]
Recompiling VirtualBox kernel module [ OK ]
Starting VirtualBox kernel module [ OK ]

For more reference, please visit http://wiki.centos.org/HowTos/Virtualization/VirtualBox

5. How to enable VT-x/AMD-V hardware acceleration?

When you started your VirtualBox and got following error, it meant that you have not enabled the VT-x/AMD-V hardware acceleration which is required for VirtualBox running on a 64-bit server.



The solution is restarting your server and enter to BIOS configuration interface and find following option and enable it.

Advanced Processor Options --> Intel (R) Virtualization Technology --> Enable.

After the server's boot up, start the VirtualBox again, you should not meet the above error again.

For more information about VT-x and AMD-V, please read http://en.wikipedia.org/wiki/X86_virtualization.