Difference between revisions of "Package:VirtualBox"

From Funtoo
Jump to: navigation, search
m (guide updating)
(guide updating)
Line 15: Line 15:
 
{{TableStart}}
 
{{TableStart}}
 
{{2ColHead|Term|Explanation}}
 
{{2ColHead|Term|Explanation}}
{{2Col|'''''Host OS''''' |The Operating System on physical hardware that VirtualBox will be installed to and run from. i.e. '''Funtoo Linux'''}}
+
{{2Col|'''''Host OS''''' |An install of Funtoo Linux on physical hardware. VirtualBox will be installed to and run from here.}}
{{2Col|'''''Guest OS'''''|The Operating System that is run '''within a Virtual Machine''' provided by VirtualBox. Could be Funtoo Linux, another GNU/Linux distribution, Windows, etc.}}
+
{{2Col|'''''Guest OS'''''|The Operating System that is run '''within a Virtual Machine''' provided by VirtualBox. The Guest OS could be Funtoo Linux, another GNU/Linux distribution, Windows, etc.}}
{{2Col|'''''Guest Additions'''''|Guest Additions is a collection of  applications, libraries and kernel modules/drivers that are installed in your Guest OS. These provide support for graphics, networking, file transfer, access to real physical devices (e.g. USB flash drive), and so on.}}
+
{{2Col|'''''Guest Additions'''''|''Guest Additions'' is a collection of  applications, libraries and kernel modules/drivers that are installed in your Guest OS. These provide support for graphics, networking, and other features such as file transfer and Guest access to real physical devices such as a USB flash drive.}}
 
{{TableEnd}}
 
{{TableEnd}}
  
= Host Installation =
+
= Host OS =
{{warning|This page is currently being redeveloped.}}
 
 
 
{{note|The following information is aimed primarily at VirtualBox on a typical "desktop" install of Funtoo Linux.}}
 
 
 
== Binary VirtualBox ==
 
 
 
VirtualBox is also available as a binary package.  If you wish to use the binary version see:
 
 
 
{{package|app-emulation/virtualbox-bin}}
 
 
 
The binary package contains extensions which are not available with the source package.
 
 
 
 
== Installation ==
 
== Installation ==
 +
VirtualBox can be installed onto your Host OS - Funtoo Linux - using one of two packages: {{c|app-emulation/virtualbox}} or {{c|app-emulation/virtualbox-bin}}. The latter "-bin" package is a binary (precompiled) copy of VirtualBox. Installing this may be preferable on machines with low computing power.
  
<console>
+
For a typical install, run
###i## echo "app-emulation/virtualbox-extpack-oracle PUEL" >> /etc/portage/package.license/virtualbox
+
{{console|body=
###i## emerge app-emulation/virtualbox
+
###i## emerge --ask app-emulation/virtualbox
</console>
+
}}
 
 
Installation of <code>app-emulation/virtualbox</code> implies <code>app-emulation/virtualbox-extpack-oracle</code>.
 
 
 
== Guest Additions ==
 
 
 
Make sure that user running X session belongs to <code>vboxguest</code> group. Create group when it does not exist. Add user to the group. That will enable :
 
 
 
*Shared clipboard;
 
*Display resizing;
 
*Seamless mode;
 
*Drag & Drop.
 
 
 
<console>
 
###i## groupadd vboxguest
 
###i## gpasswd -a ''user'' vboxguest
 
</console>
 
 
 
=== Windows Guests ===
 
{{warning|This is new information.}}
 
VirtualBox versions '''less than 5.0'''
 
 
 
You must enable <code>additions</code> USE flag when you intend to install Windows as a guest O/S. That will also install the ISO image containing all necessary Windows guest drivers.
 
 
 
VirtualBox versions '''5.0 and above'''
 
 
 
'''As of version 5.0 the USE flag''' {{c|additions}} '''has been removed from the package app-emulation/virtualbox'''. The guest additions ISO required for a Windows guest is now provided in a separate package, app-emulation/virtualbox-additions. Install this to access the guest additions ISO: {{f|/usr/share/virtualbox/VBoxGuestAdditions.iso}}.
 
 
 
=== Linux Guests ===
 
 
 
If you want to run Funtoo GNU/Linux as a guest O/S, emerge <code>app-emulation/virtualbox-guest-additions</code> in the Funtoo GNU/Linux guest O/S. For other GNU/Linux, please refer to [https://www.virtualbox.org/manual/ch04.html#idp11274368 VirtualBox documentation].
 
  
== Post Installation ==
+
== Choose VirtualBox Users ==
  
 
You will not be able to run and use VirtualBox as a regular user if you are not a member of the <code>vboxusers</code> group.
 
You will not be able to run and use VirtualBox as a regular user if you are not a member of the <code>vboxusers</code> group.
Line 80: Line 39:
 
You must re-log so changes take effect.
 
You must re-log so changes take effect.
  
=== Loading Modules ===
+
== Load VirtualBox Kernel Modules ==
  
 
Required and optional modules must be loaded before launching VirtualBox. You can do that as root or upon boot.
 
Required and optional modules must be loaded before launching VirtualBox. You can do that as root or upon boot.
Line 86: Line 45:
 
{{fancynote|<code>vboxnetadp</code> and <code>vboxnetflt</code> are optional.}}
 
{{fancynote|<code>vboxnetadp</code> and <code>vboxnetflt</code> are optional.}}
  
==== As root ====
+
=== As root ===
  
 
<console>
 
<console>
Line 94: Line 53:
 
</console>
 
</console>
  
==== Upon boot OpenRC ====
+
=== Upon boot OpenRC ===
 
 
 
Edit <code>/etc/conf.d/modules</code> :
 
Edit <code>/etc/conf.d/modules</code> :
  
 
<pre>modules="vboxdrv vboxnetadp vboxnetflt"</pre>
 
<pre>modules="vboxdrv vboxnetadp vboxnetflt"</pre>
  
=== Kernel Driver ===
+
== Start VirtualBox ==
  
 +
== Dealing with Funtoo Linux kernel updates ==
 
Each time a new kernel is installed, <code>vboxdrv</code> kernel module must be recompiled. To ensure Portage knows about that, look at <code>/var/lib/module-rebuild/moduledb</code>. The following record must be present.
 
Each time a new kernel is installed, <code>vboxdrv</code> kernel module must be recompiled. To ensure Portage knows about that, look at <code>/var/lib/module-rebuild/moduledb</code>. The following record must be present.
  
Line 108: Line 67:
 
Running <code>emerge @module-rebuild</code> will recompile VirtualBox driver after installation of new kernel.
 
Running <code>emerge @module-rebuild</code> will recompile VirtualBox driver after installation of new kernel.
  
=== EFI case ===
+
= Guest OS =
 +
{{warning|This section is currently under redevelopment.}}
 +
== Guest Additions ==
 +
Make sure that user running X session belongs to <code>vboxguest</code> group. Create group when it does not exist. Add user to the group. That will enable :
 +
 
 +
*Shared clipboard;
 +
*Display resizing;
 +
*Seamless mode;
 +
*Drag & Drop.
 +
 
 +
<console>
 +
###i## groupadd vboxguest
 +
###i## gpasswd -a ''user'' vboxguest
 +
</console>
 +
 
 +
== Windows Guests ==
 +
{{important|This is new information.}}
 +
VirtualBox versions '''less than 5.0'''
 +
 
 +
You must enable <code>additions</code> USE flag when you intend to install Windows as a guest O/S. That will also install the ISO image containing all necessary Windows guest drivers.
 +
 
 +
VirtualBox versions '''5.0 and above'''
 +
 
 +
'''As of version 5.0 the USE flag''' {{c|additions}} '''has been removed from the package app-emulation/virtualbox'''. The guest additions ISO required for a Windows guest is now provided in a separate package, app-emulation/virtualbox-additions. Install this to access the guest additions ISO: {{f|/usr/share/virtualbox/VBoxGuestAdditions.iso}}.
 +
 
 +
== Linux Guests ==
 +
 
 +
If you want to run Funtoo GNU/Linux as a guest O/S, emerge <code>app-emulation/virtualbox-guest-additions</code> in the Funtoo GNU/Linux guest O/S. For other GNU/Linux, please refer to [https://www.virtualbox.org/manual/ch04.html#idp11274368 VirtualBox documentation].
 +
 
 +
= Troubleshooting =
 +
== EFI case ==
 
latest releases of virtualbox have a volatile NVRAM and this makes an EFI guest boot troublesome. To workaround this following steps required:
 
latest releases of virtualbox have a volatile NVRAM and this makes an EFI guest boot troublesome. To workaround this following steps required:
 
* remove any CD images (like systemrescuecd) from the VM settings
 
* remove any CD images (like systemrescuecd) from the VM settings

Revision as of 12:13, May 25, 2016

VirtualBox

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

VirtualBox is a free and open source virtualization 'hypervisor' for x86-based machines. VirtualBox can be installed and run on GNU/Linux and other Operating Systems.

The virtual machines provided by VirtualBox can be used to run a number of guest Operating Systems such as GNU/Linux, Windows, and others.

VirtualBox is available for Funtoo Linux on the arch profiles x86-32bit, x86-64bit and pure-64.

VirtualBox Homepage: https://www.virtualbox.org

Glossary of Terms

TermExplanation
Host OS An install of Funtoo Linux on physical hardware. VirtualBox will be installed to and run from here.
Guest OSThe Operating System that is run within a Virtual Machine provided by VirtualBox. The Guest OS could be Funtoo Linux, another GNU/Linux distribution, Windows, etc.
Guest AdditionsGuest Additions is a collection of applications, libraries and kernel modules/drivers that are installed in your Guest OS. These provide support for graphics, networking, and other features such as file transfer and Guest access to real physical devices such as a USB flash drive.

Host OS

Installation

VirtualBox can be installed onto your Host OS - Funtoo Linux - using one of two packages: app-emulation/virtualbox or app-emulation/virtualbox-bin. The latter "-bin" package is a binary (precompiled) copy of VirtualBox. Installing this may be preferable on machines with low computing power.

For a typical install, run

root # emerge --ask app-emulation/virtualbox

Choose VirtualBox Users

You will not be able to run and use VirtualBox as a regular user if you are not a member of the vboxusers group.

root # gpasswd -a ''user'' vboxusers

You must re-log so changes take effect.

Load VirtualBox Kernel Modules

Required and optional modules must be loaded before launching VirtualBox. You can do that as root or upon boot.

   Note

vboxnetadp and vboxnetflt are optional.

As root

root # modprobe vboxdrv
root # modprobe vboxnetadp
root # modprobe vboxnetflt

Upon boot OpenRC

Edit /etc/conf.d/modules :

modules="vboxdrv vboxnetadp vboxnetflt"

Start VirtualBox

Dealing with Funtoo Linux kernel updates

Each time a new kernel is installed, vboxdrv kernel module must be recompiled. To ensure Portage knows about that, look at /var/lib/module-rebuild/moduledb. The following record must be present.

a:1:app-emulation/virtualbox-modules-''version''

Running emerge @module-rebuild will recompile VirtualBox driver after installation of new kernel.

Guest OS

   Warning

This section is currently under redevelopment.

Guest Additions

Make sure that user running X session belongs to vboxguest group. Create group when it does not exist. Add user to the group. That will enable :

  • Shared clipboard;
  • Display resizing;
  • Seamless mode;
  • Drag & Drop.
root # groupadd vboxguest
root # gpasswd -a ''user'' vboxguest

Windows Guests

   Important

This is new information.

VirtualBox versions less than 5.0

You must enable additions USE flag when you intend to install Windows as a guest O/S. That will also install the ISO image containing all necessary Windows guest drivers.

VirtualBox versions 5.0 and above

As of version 5.0 the USE flag additions has been removed from the package app-emulation/virtualbox. The guest additions ISO required for a Windows guest is now provided in a separate package, app-emulation/virtualbox-additions. Install this to access the guest additions ISO: /usr/share/virtualbox/VBoxGuestAdditions.iso.

Linux Guests

If you want to run Funtoo GNU/Linux as a guest O/S, emerge app-emulation/virtualbox-guest-additions in the Funtoo GNU/Linux guest O/S. For other GNU/Linux, please refer to VirtualBox documentation.

Troubleshooting

EFI case

latest releases of virtualbox have a volatile NVRAM and this makes an EFI guest boot troublesome. To workaround this following steps required:

  • remove any CD images (like systemrescuecd) from the VM settings
  • start the VM
  • wait for the countdown or press Esc immediately to reach the EFI shell
  • type edit startup.nsh to open the full-screen editor
  • enter "fs0:\EFI\Funtoo Linux [GRUB]\grubx64.efi" (including the double quotes, since the path contains spaces)
  • press CTRL-s (maybe twice) to save and confirm saving by pressing Enter
  • quit editor by pressing CTRL-q
  • type reset to reboot the machine (or kill the VM and boot it using the GUI)
  • wait for the countdown or press Enter to immediately run the startup.nsh script

EFI guests now should properly boot. reference reports: https://www.virtualbox.org/ticket/14279 and https://bugs.funtoo.org/browse/FL-2640