Difference between revisions of "Arch Linux VirtualBox Guest"

From ArchWiki
Jump to: navigation, search
(Updated thanks to comments.)
Line 1: Line 1:
 
[[Category:Emulators (English)]]
 
[[Category:Emulators (English)]]
 
[[Category:HOWTOs (English)]]
 
[[Category:HOWTOs (English)]]
Installing Arch under [[VirtualBox]] is straightforward. Once the install is done, if you want the guest additions under X, you have two choices:
+
Installing Arch under [[VirtualBox]] is straightforward, and additions should be installed through pacman (not through "Install Guest Additions" in VirtualBox, or a mounted ISO.)
The GPL virtual box additions which are in the ArchLinux repositories, or the additions provided by Oracle.
+
  
Follow these instructions after doing a basic install following the [[Beginners' Guide]]. Installation of the open source additions is straightforward and can be managed by the Arch repositories.
+
Follow these instructions after doing a basic install following the [[Beginners' Guide]].
  
==virtualbox - GPL Version==
 
 
Install the required package:
 
Install the required package:
  # pacman -Sy virtualbox-guest-additions
+
  # pacman -Syu virtualbox-guest-additions
  
 
Make sure the modules are loaded:
 
Make sure the modules are loaded:
Line 20: Line 18:
 
  # vi /etc/rc.conf
 
  # vi /etc/rc.conf
  
If you are running something that launches /etc/xdg/autostart/vboxclient.desktop, then you should be ready to go. If you use .xinitrc to launch things instead, you must:
+
If you are running something that launches /etc/xdg/autostart/vboxclient.desktop, such as GNOME, then you should be ready to go. If you use .xinitrc to launch things instead, you must:
  
 
  # nano ~/.xinitrc
 
  # nano ~/.xinitrc
Line 30: Line 28:
 
before launching your WM.
 
before launching your WM.
  
You should now be all set, and all guest additions should work properly. This includes OpenGL acceleration. This was confirmed to work with vbox 4.0.8. Note that the Arch packages do not currently provide an rc.vboxadd daemon, unlike the additions installed through the iso.
+
You should now be all set, and all guest additions should work properly. This was confirmed to work with vbox 4.0.8.
 
+
==virtualbox-ext-oracle==
+
Install the kernel headers, xorg (if it's not already installed), and the build tools :
+
# pacman -S kernel26-headers xorg-server base-devel
+
Make the guest additions "CD" available to the guest OS by clicking Devices->Install Guest Additions.
+
 
+
Now, mount the installed ISO containing the additions from the host, this connects a disk to /dev/cdrom:
+
# mkdir /mnt/cdrom
+
# mount /dev/cdrom /mnt/cdrom
+
Run the installer script which tests the proper architecture and installs the additions:
+
# /mnt/cdrom/VBoxLinuxAdditions.run
+
{{Note|'''rc.vboxadd''' is automatically run from /etc/rc.local}}
+
 
+
----
+
 
+
{{Note|If you upgrade the kernel in the Virtual Machine you will need to re-install the Guest Additions in order for some features to work properly.}}
+
 
+
If you need to rebuild the Oracle (PUEL) Virtual Box Additions in a guest installation of Arch Linux, use this command:
+
# /etc/rc.d/rc.vboxadd setup
+
  
 
==Troubleshooting==
 
==Troubleshooting==
  
==Enabling OpenGL acceleration in Arch Linux guests==
+
===Guest additions still don't work===
 
+
You may need to launch VBoxClient-all yourself. Add it to ~/.xinitrc.
*Make sure the user starting X in the guest is in the '''video''' group.
+
*Make sure you have checked '3D acceleration' under the VirtualBox settings on the host.
+
*Make sure you have installed drivers for your graphics card on the host. Nvidia, ATI or Intel (xf86-video-fbdev)
+
 
+
If you receive (EE) AIGLX error: vboxvideo does not export required DRI extension:
+
# ln -s /usr/lib/xorg/modules/dri /usr/lib/dri
+
 
+
{{Note | Don't compare before-after performance using glxgears! You may get a lot less FPS due to now-working vsync support. Compare performance using a real, heavy 3D application (like a game).}}
+
 
+
===Copy and paste is not working in Arch guests!===
+
You forgot to start VBoxclient-all. See above.
+
 
+
===Failed to load module vboxvideo when starting X===
+
 
+
When running the installer, you may get the following error:
+
 
+
:: Installing X.Org Server 1.9 modules
+
ln: failed to create symbolic link `/usr/lib/xorg/modules/drivers/vboxvideo_drv.so': No such file or directory
+
 
+
This, in turn, may cause X to fail to start because it can't find the vboxvideo driver. To work around this, create the "drivers" directory in /usr/lib/xorg/modules as root:
+
 
+
# mkdir /usr/lib/xorg/modules/drivers
+
 
+
Now run the installer again and the symbolic link error should be gone.
+

Revision as of 14:41, 3 June 2011

Installing Arch under VirtualBox is straightforward, and additions should be installed through pacman (not through "Install Guest Additions" in VirtualBox, or a mounted ISO.)

Follow these instructions after doing a basic install following the Beginners' Guide.

Install the required package:

# pacman -Syu virtualbox-guest-additions

Make sure the modules are loaded:

# modprobe vboxguest
# modprobe vboxsf
# modprobe vboxvideo

Add the three modules above to the MODULES array in /etc/rc.conf to have them autoloaded on reboot, too.

# nano /etc/rc.conf

or

# vi /etc/rc.conf

If you are running something that launches /etc/xdg/autostart/vboxclient.desktop, such as GNOME, then you should be ready to go. If you use .xinitrc to launch things instead, you must:

# nano ~/.xinitrc

and add

VBoxClient-all

before launching your WM.

You should now be all set, and all guest additions should work properly. This was confirmed to work with vbox 4.0.8.

Troubleshooting

Guest additions still don't work

You may need to launch VBoxClient-all yourself. Add it to ~/.xinitrc.