Difference between revisions of "VirtualBox"

From Manjaro Linux
Jump to: navigation, search
(General updates - stage 1)
m (added trouble shooting for Windows guest)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
__TOC__
 +
 +
 
= Overview =
 
= Overview =
  
 
[[file:vbox.png|left]]
 
[[file:vbox.png|left]]
 
{{tip|virtualisation is not the same as emulation. Whereas emulation makes your computer think that it is something else (such as an arcade machine or games console), virtualisation instead creates one or more virtual versions of your computer.}}
 
  
  
Line 15: Line 16:
 
* An almost unlimited capacity to install as many additional operating systems as desired...provided space is available on your hard drive to store them!
 
* An almost unlimited capacity to install as many additional operating systems as desired...provided space is available on your hard drive to store them!
  
= Enabling Virtualisation =
 
  
[[file:vt.png|thumb|left|375px]]
+
=Installing Virtualbox on Manjaro=
  
  
{{warning|Unless you know exactly what you are doing, please DO NOT alter or amend any other BIOS settings!}}
+
==Enabling Virtualisation==
  
 
+
Before installing VirtualBox, it is important to first ensure that '''virtualization''' has been enabled in your BIOS. The exact instructions for doing this vary based on your hardware. Please review the manual provided by your computer or motherboard manufacturer for specific instructions.
Before even ''thinking'' about installing VirtualBox, it is <u>'''absolutely essential'''</U> to first ensure that '''virtualisation''' has been enabled on your computer. Otherwise - if virtualisation has not been enabled - then assuming VirtualBox can even be run at all, its features and capabilities will be severely limited. For example, where VirtualBox has been installed on a 64-bit system, it will only be able to run 32-bit operating systems as Guests. As virtualisation is usually disabled by default, it will therefore be necessary to go into your computer's BIOS settings in order to activate it.  
+
 
+
Below is an example of enabling virtualisation for a HP G62 Laptop using an Intel chip-set (it may be a slightly different process for your own computer):
+
<br clear="all" />
+
 
+
1. Reboot the computer
+
 
+
2. As it restarts, press the F10 key to enter into the BIOS Menu
+
 
+
3. Use the arrow keys to scroll across to the '''System Configuration''' tab
+
 
+
4. Use the arrow keys to highlight the '''Virtualisation Technology''' option, and press <enter>
+
 
+
5. Select the '''Enabled''' option, and press <enter>
+
 
+
6. Use the arrow keys to scroll across to the '''Exit''' tab
+
 
+
7. Ensure that the '''Exit Saving Changes''' option is highlighted and press <enter>
+
 
+
 
+
= Installing VirtualBox and its Extension Pack=
+
 
+
 
+
Although a basic VirtualBox Installation may suffice for some users, it is also recommended to download and install the optional '''Extension Pack''' for it. This provides several new features, including the ability to use USB devices such as data sticks and printers in virtual machine environments.
+
  
  
 
==Install VirtualBox==
 
==Install VirtualBox==
 
  
 
To install VirtualBox, you need to install the packages {{ic|virtualbox}} and {{ic|linux*-virtualbox-host-modules}}.  The latter must match the version of the kernel you are running.
 
To install VirtualBox, you need to install the packages {{ic|virtualbox}} and {{ic|linux*-virtualbox-host-modules}}.  The latter must match the version of the kernel you are running.
Line 57: Line 32:
 
To install VirtualBox and automatically install the kernel modules for your installed kernels enter the following command in the terminal:
 
To install VirtualBox and automatically install the kernel modules for your installed kernels enter the following command in the terminal:
  
  pamac install virtualbox $(pacman -Qsq "^linux" | grep "^linux[0-9]*$" | awk '{print $1"-virtualbox-host-modules"}' ORS=' ')  
+
  pamac install virtualbox $(pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-virtualbox-host-modules"}' ORS=' ')  
  
  
Line 65: Line 40:
  
  
==Install the Extension Pack==
+
==Install the Extension Pack(Optional)==
  
 
The virtualbox extension pack is available from [[Arch_User_Repository|Arch User Repositoty(AUR)]].  You can install it with:
 
The virtualbox extension pack is available from [[Arch_User_Repository|Arch User Repositoty(AUR)]].  You can install it with:
  pamac install virtualbox-ext-oracle
+
  pamac build virtualbox-ext-oracle
  
  
= Adding Your Account to the vbox User Group =
+
== Adding Your Account to the '''vboxusers''' User Group ==
  
 +
The final step is to now add your personal user account to the {{ic|vboxusers}} group. This is necessary in order to fully access the features provided by VirtualBox, including the ability to use USB devices in a Guest operating system.
  
The final step is to now add your personal user account to the '''vbox User Group'''. This is necessary in order to fully access the features provided by VirtualBox, including the ability to use USB devices in a Guest operating system.
 
  
 
+
The command to add your user-name to the '''vboxusers''' group is:
The command to add your user-name to the vbox user group is:
+
 
  sudo gpasswd -a $USER vboxusers
 
  sudo gpasswd -a $USER vboxusers
  
Line 83: Line 57:
 
You must logout for the change to take effect.
 
You must logout for the change to take effect.
  
 +
=Running Manjaro under VirtualBox=
  
= Advice, Tips, and Tricks =
+
For those intending to use Manjaro under VirtualBox, you can install Manjaro as usual. Please observe below point of setting the correct display type.
  
{{tip|The '''[http://www.virtualbox.org/manual/ VirtualBox Manual]''' will be of immense use to new users.}}
+
==Selecting a Display Controller==
  
 +
Before installation of Manjaro ensure the correct display settings for VM.
  
Advice on using Virtualbox effectively, as well as some tips and tricks learned along the way, have been provided for the benefit of new users.
+
{{Tip | '''Graphics''': '''128MB''', '''VBoxSVGA''', '''Enable 3D Acceleration'''.}}
  
 +
Once it is installed run the following command to ensure the kernel modules are installed and install the guest utils:
 +
pamac install virtualbox-guest-utils $(pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-virtualbox-guest-modules"}' ORS=' ')
  
==Running Manjaro in VirtualBox==
+
You will need to load the modules if you don't want to reboot:
 +
sudo modprobe vboxguest vboxvideo vboxsf
  
For those intending to use VirtualBox in Ubuntu or an Ubuntu-based distribution (e.g. Mint, Zorin, Kubuntu, etc) - in order to run Manjaro in it, of course! - the author has provided a comprehensive YouTube VirtualBox video guide:
+
Add you VM user to the vboxsf group
 +
sudo gpasswd -a $USER vboxsf
  
* Part 1: '''[http://www.youtube.com/watch?v=a9PusQjgzPU VirtualBox Introduction]'''
+
The guest utils than need to be started and enabled:
* Part 2: '''[http://www.youtube.com/watch?v=Wh9-WtRb6LQV BIOS Settings and Installation]'''
+
sudo systemctl enable --now vboxservice.service
* Part 3: '''[http://www.youtube.com/watch?v=3TGNfmhoSts Virtual Machine Setup and vbox User Group]'''
+
* Part 4: '''[http://www.youtube.com/watch?v=syWEboy5KoM ISO installation, Internet Connection, and Guest Additions]'''
+
  
 +
= Advice, Tips, and Tricks =
  
Existing Manjaro users may still find Part 3 of particular interest if they are unfamiliar with using VirtualBox. '''However, please note that the Guest Additions section in the fourth video does not apply to Manjaro or <u>any</u> Arch-based distribution'''.
+
Advice on using Virtualbox effectively, as well as some tips and tricks learned along the way, have been provided for the benefit of new users.
 
+
For Manjaro the Guest Additions is installed using the command
+
pamac install virtualbox-guest-utils
+
 
+
More importantly, using the method shown to install Guest Additions in Manjaro (or any Arch-based distribution) will break the system permanently, rendering it unusable.
+
  
  
 
==Guest Installation==
 
==Guest Installation==
  
* Virtualbox can run installation files (ISOs) directly as ''virtual discs'', so there is no need to burn them to an installation medium such as a disc or USB data stick.
+
* Virtualbox can run installation files (ISOs) directly as virtual discs, so there is no need to burn them to an installation medium such as a disc or USB data stick.
 +
 
 +
* The process to install any Guest operating system, [[Installation_Guides|including Manjaro]], is exactly the same as if actually installing for real on your computer.
  
* The process to install any Guest operating system - '''[[Installation_Guides|including Manjaro]]''' - is exactly the same as if actually installing for real on your computer.
 
  
 
==Guest Additions==
 
==Guest Additions==
Line 120: Line 95:
 
Guest Additions are special software packages designed to improve the performance and usability of guest operating systems.  
 
Guest Additions are special software packages designed to improve the performance and usability of guest operating systems.  
  
They are installed '''within''' the Guest operating system itself, and most notably result in enhancing the display resolution, as well as enabling much better control over the mouse. As such, two tell-tale signs that Guest Additions have not been installed in a Guest are that the display will not scale to the size of the display window (i.e. it will be necessary to scroll around to see the whole screen), and the mouse may be quite hard to control.
+
 
 +
They are installed within the Guest operating system itself, and most notably result in enhancing the display resolution, as well as enabling much better control over the mouse. As such, two tell-tale signs that Guest Additions have not been installed in a Guest are that the display will not scale to the size of the display window (i.e. it will be necessary to scroll around to see the whole screen), and the mouse may be quite hard to control.
 +
 
 +
 
 +
Instructions for installing the guest additions in Manjaro are provided above.  For other operating systems please review the VirtualBox instructions [[#See Also|linked below]]
 +
 
  
 
==Guest Display==
 
==Guest Display==
  
* It will be necessary to activate the '''Enable 3D acceleration''' box in order to allow for some desktop effects (such as transparency) to be shown. This can be undertaken by going into the settings menu, and then selecting the '''Display''' section.
+
It will be necessary to activate the '''Enable 3D acceleration''' box in order to allow for some desktop effects (such as transparency) to be shown. This can be undertaken by going into the settings menu, and then selecting the '''Display''' section.
  
 +
If you are getting screen distortion or transparent dialogs using Windows guest - shutdown the VM and change the graphics settings of the VM. Remove the checkbox for '''Enable 3D acceleration'''.
  
 
==Guest Internet Connection==
 
==Guest Internet Connection==
  
Some users have encountered problems when attempting to connect their virtual machine to the internet using the default VirtualBox settings. Where this is the case, try the following solution (covered in the fourth VirtualBox YouTube Tutorial from the 4:28 mark):
+
Some users have encountered problems when attempting to connect their virtual machine to the internet using the default VirtualBox settings. Where this is the case, try the following solution  
  
 
1. Click the '''Settings Button''' and then select the '''Network''' tab
 
1. Click the '''Settings Button''' and then select the '''Network''' tab
  
2. Next to the '''Attached to''' heading is a button that states '''NAT'''. Click it to reveal a drop down menu and select '''Bridged Adaptor''' instead.
+
2. Next to the '''Attached to''' heading is a button that states '''NAT'''. Click it to reveal a drop down menu and select '''Bridged Adapter''' instead.
  
 
3. Next to the '''Name''' heading is a button whereby you may select how you are currently connected to the internet (e.g. ''Wlan'' means Wireless, and ''Eth0'' means Ethernet). Select the appropriate connection type you are currently using.
 
3. Next to the '''Name''' heading is a button whereby you may select how you are currently connected to the internet (e.g. ''Wlan'' means Wireless, and ''Eth0'' means Ethernet). Select the appropriate connection type you are currently using.
Line 140: Line 121:
  
  
==General==
+
==General Troubleshooting==
  
 
* A VirtualBox installation may not automatically detect when USB device has been connected. As such, it may therefore be necessary to click the USB icon located at the bottom of the VirtualBox window in order to select and activate it.
 
* A VirtualBox installation may not automatically detect when USB device has been connected. As such, it may therefore be necessary to click the USB icon located at the bottom of the VirtualBox window in order to select and activate it.
Line 148: Line 129:
 
* Don't be afraid to take risks, to experiment, and to have fun with Guest operating systems. The worst that can happen is that they will have to be re-installed!
 
* Don't be afraid to take risks, to experiment, and to have fun with Guest operating systems. The worst that can happen is that they will have to be re-installed!
  
==VirtualBox in the Forum==
+
 
If you have problems installing ask here [https://forum.manjaro.org/t/how-to-install-virtualbox/22183 How to install VirtualBox]
+
=See Also=
 +
* [https://forum.manjaro.org/t/how-to-install-virtualbox/22183 How to install VirtualBox Forum Topic]
 +
* [https://forum.manjaro.org/t/howto-virtualbox-installation-usb-devices-and-shared-folders/55905 VirtualBox Installation, USB and Shared Folders Forum Wiki HowTo]
 +
* The [http://www.virtualbox.org/manual/ VirtualBox Manual]
  
  
 
[[Category:Contents Page]]
 
[[Category:Contents Page]]
[[Category:Virtualisation]]
 

Latest revision as of 09:31, 11 October 2019


Overview

Vbox.png


Developed by Sun Microsystems, now Oracle Corporation, VirtualBox is a popular application that allows for other operating systems (known as Guests) to be installed and run within an existing operating system (known as the Host). This is undertaken through the process of virtualisation, whereby virtual versions of your computer (also referred to as virtual machines or VMs) are created within and draw resources directly from the host system. As such, how fast or powerful a virtual machine may be will depend entirely on the resources available - and allocated - for it to use. The benefits of virtualisation include:

  • The fast and easy installation of other operating systems without affecting your existing system (e.g. no need for dual booting and/or preparation in the form of hard disk partitioning or re-sizing)
  • Completely safe learning and experimentation with operating systems, as nothing that occurs within a Guest will affect the Host (e.g. the Host operating system can also be installed as a Guest in a virtual machine as a risk-free means of trying out new things), and
  • An almost unlimited capacity to install as many additional operating systems as desired...provided space is available on your hard drive to store them!


Installing Virtualbox on Manjaro

Enabling Virtualisation

Before installing VirtualBox, it is important to first ensure that virtualization has been enabled in your BIOS. The exact instructions for doing this vary based on your hardware. Please review the manual provided by your computer or motherboard manufacturer for specific instructions.


Install VirtualBox

To install VirtualBox, you need to install the packages virtualbox and linux*-virtualbox-host-modules. The latter must match the version of the kernel you are running.


To install VirtualBox and automatically install the kernel modules for your installed kernels enter the following command in the terminal:

pamac install virtualbox $(pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-virtualbox-host-modules"}' ORS=' ') 


Once the installation has completed, it will then be necessary to add the VirtualBox Module to your kernel. The easy way is to simply reboot your system. Otherwise, to start using VirtualBox immediately, enter the following command:

sudo vboxreload


Install the Extension Pack(Optional)

The virtualbox extension pack is available from Arch User Repositoty(AUR). You can install it with:

pamac build virtualbox-ext-oracle


Adding Your Account to the vboxusers User Group

The final step is to now add your personal user account to the vboxusers group. This is necessary in order to fully access the features provided by VirtualBox, including the ability to use USB devices in a Guest operating system.


The command to add your user-name to the vboxusers group is:

sudo gpasswd -a $USER vboxusers


You must logout for the change to take effect.

Running Manjaro under VirtualBox

For those intending to use Manjaro under VirtualBox, you can install Manjaro as usual. Please observe below point of setting the correct display type.

Selecting a Display Controller

Before installation of Manjaro ensure the correct display settings for VM.

Tip: Graphics: 128MB, VBoxSVGA, Enable 3D Acceleration.

Once it is installed run the following command to ensure the kernel modules are installed and install the guest utils:

pamac install virtualbox-guest-utils $(pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-virtualbox-guest-modules"}' ORS=' ')

You will need to load the modules if you don't want to reboot:

sudo modprobe vboxguest vboxvideo vboxsf

Add you VM user to the vboxsf group

sudo gpasswd -a $USER vboxsf

The guest utils than need to be started and enabled:

sudo systemctl enable --now vboxservice.service

Advice, Tips, and Tricks

Advice on using Virtualbox effectively, as well as some tips and tricks learned along the way, have been provided for the benefit of new users.


Guest Installation

  • Virtualbox can run installation files (ISOs) directly as virtual discs, so there is no need to burn them to an installation medium such as a disc or USB data stick.
  • The process to install any Guest operating system, including Manjaro, is exactly the same as if actually installing for real on your computer.


Guest Additions

Guest Additions are special software packages designed to improve the performance and usability of guest operating systems.


They are installed within the Guest operating system itself, and most notably result in enhancing the display resolution, as well as enabling much better control over the mouse. As such, two tell-tale signs that Guest Additions have not been installed in a Guest are that the display will not scale to the size of the display window (i.e. it will be necessary to scroll around to see the whole screen), and the mouse may be quite hard to control.


Instructions for installing the guest additions in Manjaro are provided above. For other operating systems please review the VirtualBox instructions linked below


Guest Display

It will be necessary to activate the Enable 3D acceleration box in order to allow for some desktop effects (such as transparency) to be shown. This can be undertaken by going into the settings menu, and then selecting the Display section.

If you are getting screen distortion or transparent dialogs using Windows guest - shutdown the VM and change the graphics settings of the VM. Remove the checkbox for Enable 3D acceleration.

Guest Internet Connection

Some users have encountered problems when attempting to connect their virtual machine to the internet using the default VirtualBox settings. Where this is the case, try the following solution

1. Click the Settings Button and then select the Network tab

2. Next to the Attached to heading is a button that states NAT. Click it to reveal a drop down menu and select Bridged Adapter instead.

3. Next to the Name heading is a button whereby you may select how you are currently connected to the internet (e.g. Wlan means Wireless, and Eth0 means Ethernet). Select the appropriate connection type you are currently using.

4. Click the OK button to confirm.


General Troubleshooting

  • A VirtualBox installation may not automatically detect when USB device has been connected. As such, it may therefore be necessary to click the USB icon located at the bottom of the VirtualBox window in order to select and activate it.
  • It is possible to enable the (very useful) ability to copy and paste text between the Guest and Host systems. This is undertaken by clicking Settings button and then going to the General Section.
  • Don't be afraid to take risks, to experiment, and to have fun with Guest operating systems. The worst that can happen is that they will have to be re-installed!


See Also