The Guest Additions are designed to be installed inside a virtual machine after the guest operating system has been installed. They consist of device drivers and system applications that optimize the guest operating system for better performance and usability.
The VirtualBox Guest Additions for all supported guest operating systems are provided as a single CD-ROM image file which is called VBoxGuestAdditions.iso.
To install the Guest Additions for a particular VM, you mount this ISO file in your VM as a virtual CD-ROM and install from there.
The features provided include:
- Mouse pointer integration. The Host key is no longer required to "free" the mouse from being captured by the guest OS.
- Shared folders.
- Better video support. You can resize the VM's screen, and the video resolution in the guest will be automatically adjusted.
- Seamless windows. VirtualBox suppresses the display of the Desktop background of your guest. The individual windows that are displayed on the desktop of the VM can be mapped on the host's desktop, as if the underlying application was actually running on the host.
- Generic host/guest communication channels.
- Time synchronization.
- Shared clipboard.
- Automated logons (credentials passing).
For reference, find the "Host Key customization" section in VirtualBox manual.
Right Ctrl: HOME
With HOME+(Key), (Key) could be:
- F: FullscreenMode.
- L: SeamlessMode.
- Q: Close. Show the VM close dialog.
- S: SettingDialog. Open the VM settings dialog.
- H: Shutdown. Press the ACPI power button.
- P: Pause. Pause the VM.
- Del: TypeCAD. Inject Ctrl+Alt+Del.
- I: MouseIntegration.
- E: TakeScreenshot.
- T: TakeSnapshot.
- Backspace: TypeCABS. Inject Ctrl+Alt+Backspace.
- HOME: Show the menu. Useful in auto-scaling mode.
# Disable the full screen mode as well as the seamless mode VBoxManage setextradata global GUI/Input/MachineShortcuts "FullscreenMode=None,SeamlessMode=None" # Redefine or disable certain host key actions VBoxManage setextradata global GUI/Input/MachineShortcuts "FullscreenMode=F,...."
Connect host directly to guest, host-only network
Host-Only networking is a good solution, which makes host and all the guests talk to each other. See Ubuntu Forum for installation guide. In short,
- Add a new host-only network. From the main menu, select File - Preferences (Ctrl+G) - Network - Host-only Networks, add a new host-only network, which is named as "vboxnet0" by default. WcfNOTE: NOT the settings of a single vm.
- Now add the host-only network for each guest VM.
- Ifconfig on both host and guest. By default, the new IP for host is 192.168.56.1, and guest starting from 192.168.56.101.
- On host:
Dynamic storage not allocated
On my archLinux guest OS, when I compiled with GCC, it complaint about not enough space. However, the virtual size is 16G which was enough while the actual size is 1.8G which was not. Create some big file to trigger the dynamic allocation of virtual box's VDI:
dd if=/dev/zero of=testFile bs=1M count="size in megabytes"
Install guest additions on CentOS
sudo yum install epel-release sudo yum install dkms sudo yum install gcc kernel-devel make # reboot... # Click Devices/Install Guest Additions... # Mount the ISO image. sudo mkdir /mnt/cdrom sudo mount /dev/cdrom /mnt/cdrom sudo /mnt/cdrom/VBoxLinuxAdditions.run # Now the shared folder "virShare" could be found at: ls /media/sf_virShare # Always mount mkdir ~/virShare mount -t vboxsf virShare ~/virShare
Use arch as guest
# dkms is preferred and recommended. pacman -S linux-headers virtualbox-guest-dkms # Another way is the modules directly. # pacman -S virtualbox-guest-modules-arch # Load the modules manually. modprobe -a vboxguest vboxsf vboxvideo # Install this. It will create a group vboxsf. pacman -S virtualbox-guest-utils # Add me to this group. sudo usermod -aG vboxsf me # Add the shared folder to guest. sudo mount -t vboxsf -o ro,uid=1000,gid=1000 sharedName ~/works/