VirtualBox
Visão geral
Desenvolvido pela Sun Microsystems, agora Oracle Corporation, [1] é um programa popular que permite que outro sistema operacional (conhecido como Convidado) seja instalado e executado dentro de um sistema operacional existente (Conhecido como Host). Isto é realizado através do processo de virtualização, em que versões virtuais do seu computador (também conhecido como Máquinas Virtuais ou VMs) são criados e extraem recursos diretamente do sistema host. Como tal, o quão rápida ou poderosa uma máquina virtual pode ser dependerá inteiramente dos recursos disponíveis – e alocados – para uso. Os benefícios da virtualização incluem:
- A instalação rápida e fácil de outros sistemas operacionais sem afetar o sistema existente (ex. não há necessidade de Dual Boot ou de particionamento ou redimensionamento do disco rígido)
- Aprendizagem e experimentação completamente seguras com sistemas operacionais, pois nada que ocorra dentro de um Convidado afetará o Host (por exemplo, o sistema operacional Host também pode ser instalado como um Convidado em uma máquina virtual como um meio livre de riscos de experimentar coisas novas), e
- Uma capacidade quase ilimitada para instalar quantos sistemas operacionais adicionais desejar...desde que haja espaço disponível em seu disco rígido para armazená-los!
Instalando Virtualbox no Manjaro
Ativando a Virtualização
Antes de instalar o VirtualBox, é importante primeiro garantir que a virtualização foi ativado na BIOS. As instruções exatas para fazer isso variam de acordo com o seu hardware. Consulte o manual fornecido pelo fabricante do seu computador ou placa-mãe para obter instruções específicas.
Instale o VirtualBox
Para instalar o VirtualBox, você precisa instalar os pacotes virtualbox
e linux*-virtualbox-host-modules
. Este último deve corresponder à versão do kernel que você está executando. Para listar quais kernels estão instalados use mhwd
(exemplo)
$ mhwd-kernel -li Atualmente em execução:: 5.4.0-1-MANJARO (linux54) Os seguintes kernels estão instalados em seu sistema: * linux54
Para instalar o VirtualBox e os módulos de kernel para o seu kernel instalado, digite o seguinte comando no terminal:
$ sudo pacman -Syu virtualbox linux54-virtualbox-host-modules
Assim que a instalação for concluída, será necessário adicionar o VirtualBox Module para o seu kernel. A maneira mais fácil é simplesmente reiniciar o sistema. Caso contrário, para começar a usar o VirtualBox imediatamente, digite o seguinte comando:
$ sudo vboxreload
Instale o Pacote de Extensão(Opcional)
O pacote de extensões é um conjunto proprietário de extensões que fornece funcionalidade extra ao VirtualBox, como porta USB2 e USB3. Você só precisa disso se quiser usar a funcionalidade fornecida e for não requerido para o VirtualBox funcionar.
- Integração da Oracle Cloud Infrastructure
- USB 2.0 e USB 3.0 Host Controller
- Host Webcam
- VirtualBox RDP
- PXE ROM
- Criptografia de disco
- NVMe
Check your VirtualBox version (example)
$ vboxmanage --version 6.1.14r140239
Install extensionpack using AUR
Locate the correct AUR PKGBUILD using pamac (or the AUR helper of choice) - example is using pamac
$ pamac search virtualbox-ext-oracle virtualbox-ext-oracle-manjaro 6.1.12-2 AUR Oracle VM VirtualBox Extension Pack virtualbox-ext-oracle-beta 6.1.0_RC1-1 AUR Oracle VM VirtualBox Extension Pack (Beta) virtualbox-ext-oracle-5-test-build 5.2.35_135314-1 AUR Oracle VM VirtualBox Extension Pack Test Build 5.2.35_135314 virtualbox-ext-oracle-5.0 5.0.40-1 AUR Oracle VM VirtualBox Extension Pack virtualbox-ext-oracle-5 5.2.x-1 AUR Oracle VM VirtualBox Extension Pack 5.2.x (stable) virtualbox-ext-oracle 6.1.14-1 AUR Oracle VM VirtualBox Extension Pack
When you have found the match you can install using the helper - example is using pamac
$ pamac build virtualbox-ext-<your-decision>
Get extensionpack from VirtualBox
Same rule apply - match your VirtualBox version - usually the latest version applies.
If the latest version do not match yours - you can find earlier versions using this page
The extension .vbox-extpack is a registered mime extension so just open the file and VirtualBox will install the extension pack. Provide your password when asked.
Configuring the host
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. The $USER variable translates to the currently logged in user and you must logout or restart for the change to take effect.
$ sudo gpasswd -a $USER vboxusers
Manjaro VBox guest
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. The Manjaro recommendation - to ensure the best experience - is contradicting the recommendations from VirtualBox developers. To have the VM screensize adapting to the window size - you need enable VBoxSVGA but doing so you cannot enable 3D. To use 3D you need to use VMSVGA which will force you to set the VM screen size inside the VM. If you use the VMSVGA adapter - mhwd will keep telling you to switch - you can do it but you will not be able to utilize 3D graphics.
Troubleshooting guest
If you deem it necessary to ensure the packages are installed please follow this recipe
$ mhwd-kernel -li Currently running: 5.4.0-1-MANJARO (linux54) The following kernels are installed in your system: * linux54 $ sudo pacman -Syu virtualbox-guest-utils linux54-virtualbox-guest-modules
Guest Configuration
You will need to load the modules if you don't want to reboot:
$ sudo modprobe vboxguest vboxvideo vboxsf
The guest utils than need to be started and enabled:
$ sudo systemctl enable --now vboxservice.service
Add you VM user to the vboxsf group (this requires you to logout to apply the new group)
$ sudo usermod -aG vboxsf ${USER}
Create media folder in root directory if it does not already exist
$ sudo mkdir /media
Assign the correct permissions to the media folder to be able to access shared folders
$ sudo chmod 755 /media
Avisos, Dicas e Truques
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
If you are using other guests e.g. Ubuntu, Linux Mint and others be sure to use the default VMSVGA display driver.
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
- Click the Settings Button and then select the Network tab
- 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.
- 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.
- Click the OK button to confirm.
General Troubleshooting
- A VirtualBox installation will not automatically detect when USB device has been connected. As such, it is therefore 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!