Difference between revisions of "HOWTO: Install VirtualBox"

From Sabayon Wiki
Jump to: navigation, search
(Entropy)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{I18n| [[HOWTO:_Install_VirtualBox_(Proprietary)|en]] [[Ru:HOWTO:_Install_VirtualBox_(Proprietary)|ru]]}}
 
{{I18n| [[HOWTO:_Install_VirtualBox_(Proprietary)|en]] [[Ru:HOWTO:_Install_VirtualBox_(Proprietary)|ru]]}}
==Entropy==
 
Run these two commands in order to install via Entropy, the fastest, simplest and safest method.
 
{{Console|<pre class="clear">
 
equo update
 
equo install virtualbox-bin virtualbox-modules
 
depmod -a
 
modprobe vboxdrv
 
modprobe vboxnetadp
 
modprobe vboxnetflt
 
</pre>}}
 
to get virtualbox modules loaded automatically
 
{{Console|<pre class="clear">
 
nano /etc/conf.d/modules
 
</pre>}}
 
 
add to it:
 
{{File|/etc/conf.d/modules| <pre class="clear">
 
modules_2_6="vboxdrv"
 
module_vboxdrv_args=""
 
</pre>}}
 
 
 
==Portage==
 
==Portage==
 
To install via Portage:
 
To install via Portage:
Line 37: Line 16:
 
  eselect kernel list
 
  eselect kernel list
 
  eselect kernel set kernel.number.you.want.here
 
  eselect kernel set kernel.number.you.want.here
  emerge --sync && layman -S
+
  emerge --sync && layman -S << when using eix, use eix-sync instead.
  emerge -av app-emulation/virtualbox-ose app-emulation/virtualbox-modules
+
  emerge -av app-emulation/virtualbox-bin app-emulation/virtualbox-modules
 
</pre>}}
 
</pre>}}
==Manually==
 
1. Download the latest VirtualBox from [http://www.virtualbox.org/wiki/Linux_Downloads]
 
  
 +
If Portage wants to install a new kernel, but you want to stick with your current kernel, use:
 
{{Console|<pre class="clear">
 
{{Console|<pre class="clear">
  su -
+
  emerge -av --nodeps app-emulation/virtualbox-bin app-emulation/virtualbox-modules
chmod +x VirtualBox-1.6.2-Linux_amd64.run
+
 
</pre>}}
 
</pre>}}
 +
Make sure that kernel-sources are installed, otherwise virtualbox-modules will fail to compile !!!
  
2. Unistall OSE (if installed)
+
If you DO want the new kernel, you can install it first, using kernel-switcher:
{{Console|<pre class="clear">
+
[[Entropy#Using_Kernel_Switcher]]
equo remove --deep --configfiles app-emulation/virtualbox-bin app-emulation/virtualbox-modules
+
</pre>}}
+
  
3. Run the 1.6.2 Installer
+
For Genkernel users, follow this guide:
{{Console|<pre class="clear">
+
[[HOWTO:_Upgrade_kernel_using_genkernel]]
./VirtualBox-1.6.2-Linux_amd64.run
+
</pre>}}
+
  
4. Continue:
+
3. Follow the steps below to load the modules, and add yourself to the "vboxusers" group.
Verifying archive integrity... All good.
+
Uncompressing VirtualBox for Linux installation........
+
VirtualBox Version 1.6.2 (Sat May 31 04:05:23 CEST 2008) installation
+
  
If you are upgrading from VirtualBox 1.5 or older and if some of your virtual
+
    # depmod -a
machines have saved states, then the saved state information will be lost
+
after the upgrade and will have to be discarded.  If you do not want this then
+
you can cancel the upgrade now.
+
+
Do you wish to continue? [yes or no]
+
yes
+
Removing previous installation of VirtualBox  from /opt/VirtualBox
+
Installing VirtualBox to /opt/VirtualBox-1.6.2
+
Building the VirtualBox kernel module
+
Failed to build the kernel module.  Please check the log file /var/log/vbox-install.log for more information.
+
Failed to start networking on the guest.  Please check the log file /var/log/vbox-install.log for more information.
+
  
VirtualBox has been installed successfully, but the kernel module could not
+
    # modprobe vboxdrv
be built.  When you have fixed the problems preventing this, execute
+
  /etc/init.d/vboxdrv setup
+
as administrator to build it.
+
  
You will find useful information about using VirtualBox in the user manual
+
    # modprobe vboxnetadp
  /opt/VirtualBox-1.6.2/UserManual.pdf
+
 
and in the user FAQ
+
    # modprobe vboxnetflt
  http://www.virtualbox.org/wiki/User_FAQ
+
 
 +
    # usermod -a -G vboxusers YOUR_USER_NAME
 +
 
 +
After this '''you must log out and log in''', otherwise you'll get "Permission denied" error if you try to run "VirtualBox" command.
 +
 
 +
{{Note| Please note that, when starting VirtualBox in a terminal, the command is: '''V'''irtual'''B'''ox  (watch the Capitals),
 +
 
 +
Without the Capitals, but just plain insert:"virtualbox", the command is not found......}}
 +
 
 +
To get virtualbox modules to load automatically:
 +
 
 +
    # nano -w /etc/conf.d/modules
 +
 
 +
add to it:
 +
 
 +
    modules="vboxdrv vboxnetflt vboxnetadp"
 +
 
 +
then save and exit, reboot.
 +
 
 +
{{Note| You do not need to install xf86-input-virtualbox and xf86-video-virtualbox. These are for installation '''in the guest OS, if it is Sabayon Linux''', not in the host OS.}}
 +
 
 +
== Setup a Guest OS ==
 
   
 
   
We hope that you enjoy using VirtualBox.
+
Setting the Guest OS up, is a case of following the Wizard, which is very intuitive.
  
 +
1) Open VirtualBox
  
5. The kernel module fails? Oh well!
+
2) Click on New
{{Console|<pre class="clear">
+
 
  cd /opt/VirtualBox-1.6.2/src
+
3) Click on Next
</pre>}}
+
 
6. Run the make
+
4) Add a name for your OS (Lets assume you are installing WinXP) so enter '''Windows XP'''
{{Console|<pre class="clear">
+
 
make && make install
+
5) Choose the OS Type from the drop down menu (Windows XP)
</pre>}}
+
 
7. Load the module
+
6) Click Next
{{Console|<pre class="clear">
+
 
modprobe vboxdrv
+
7) Set your base memory size, (''as a rule of thumb, never set this to more than half the host machines actual memory, otherwise the host grinds to a halt'')
</pre>}}
+
 
8. Load at module at start-up (reccomended but optional)
+
8) Click Next
{{Console|<pre class="clear">
+
 
echo '"modules_2_6="vboxdrv vboxnetflt"' >> /etc/conf.d/modules
+
9) This will take you to the hard disk allocation page, where on a new install you will need to click on New and launch another Wizard,
</pre>}}
+
 
9. Enjoy your improved USB support :D
+
10) Virtual Disk image type, set this to Dynamically expanding image
 +
 
 +
11) Click Next
 +
 
 +
12) Set the image name to WinXP and the Image size to something over 4Gb
 +
 
 +
13) Click Next
 +
 
 +
14) A Summary will display, click finish
 +
 
 +
15) This will take you back to the Virtual Hard disk page, where you will be able to select the WinXP hard disk from the drop down menu
 +
 
 +
16) Click Next
 +
 
 +
17) Click on Finish
 +
 
 +
18) This will take you back to the Main Virtualbox interface.
 +
 
 +
To Launch the New system click on it once, and click on start. and the Virtual system will start to load, however with no CD in the CD Rom the system will probably stop when it looks for an OS.
 +
 
 +
You can load the Guest OS either from the CD-ROM, or from an ISO image, which is setup via the Settings option, when the Virtual machine is powered down.
 +
 
 +
== Guest Additions ==
 +
 
 +
 
 +
Now if you are using Virtualbox to run Windows XP as the guest OS, it is worthwhile loading the Guest Additions
 +
 
 +
The Guest additions allow you to do some really funky stuff, like have the mouse pointer work across both guest and host applications: Better Video drivers, and Seamless integration.
 +
 
 +
In the “Devices” menu in the virtual machine’s menu bar, VirtualBox has a handy menu
 +
item named “Install guest additions”, which will automatically bring up the Additions
 +
in your VM window.
 +
 
 +
If you prefer to mount the additions manually, you can perform the following steps:
 +
 
 +
1. Start the virtual machine where you have installed a Windows guest operating
 +
system.
 +
 
 +
2. Select “Mount CD/DVD-ROM” from the “Devices” menu in the virtual machine’s
 +
menu bar and then “CD/DVD-ROM image”. This brings up the Virtual Disk Man-
 +
ager.
 +
 
 +
3. In the Virtual Disk Manager, press the “Add” button and browse your host file
 +
system for the VBoxGuestAdditions.iso file:
 +
 
 +
• On a Linux host, you can find this file in the additions folder under where
 +
you installed VirtualBox (normally /opt/VirtualBox-1.5.0).
 +
 
 +
4. Back in the Virtual Disk Manager, select that ISO file and press the “Select” but-
 +
ton. This will mount the ISO file and present it to your Windows guest as a
 +
CD-ROM.
  
[[User:Thev00d00|v00d00]] 13:30, 14 April 2009 (UTC)
+
Once you have rebooted the Guest System, you can click on Machine -> Seamless mode and the apps you launch in the Guest OS, will behave no in a window, but actually on your desktop environment.
  
 +
[[User:Thev00d00|v00d00]]
 
[[Category:Virtual Machines|Install VirtualBox]]
 
[[Category:Virtual Machines|Install VirtualBox]]

Revision as of 00:07, 25 November 2012

i18n: en ru

Portage

To install via Portage:

1. Edit /etc/make.conf

nano /etc/make.conf

and add the following line:

File: /etc/make.conf
ACCEPT_LICENSE="*"

2. Install VirtualBox

 eselect kernel list
 eselect kernel set kernel.number.you.want.here
 emerge --sync && layman -S  << when using eix, use eix-sync instead.
 emerge -av app-emulation/virtualbox-bin app-emulation/virtualbox-modules

If Portage wants to install a new kernel, but you want to stick with your current kernel, use:

 emerge -av --nodeps app-emulation/virtualbox-bin app-emulation/virtualbox-modules

Make sure that kernel-sources are installed, otherwise virtualbox-modules will fail to compile !!!

If you DO want the new kernel, you can install it first, using kernel-switcher: Entropy#Using_Kernel_Switcher

For Genkernel users, follow this guide: HOWTO:_Upgrade_kernel_using_genkernel

3. Follow the steps below to load the modules, and add yourself to the "vboxusers" group.

    # depmod -a
    # modprobe vboxdrv
    # modprobe vboxnetadp
    # modprobe vboxnetflt
    # usermod -a -G vboxusers YOUR_USER_NAME

After this you must log out and log in, otherwise you'll get "Permission denied" error if you try to run "VirtualBox" command.

Question.png
Please note that, when starting VirtualBox in a terminal, the command is: VirtualBox (watch the Capitals), Without the Capitals, but just plain insert:"virtualbox", the command is not found......

To get virtualbox modules to load automatically:

    # nano -w /etc/conf.d/modules

add to it:

    modules="vboxdrv vboxnetflt vboxnetadp"

then save and exit, reboot.

Question.png
You do not need to install xf86-input-virtualbox and xf86-video-virtualbox. These are for installation in the guest OS, if it is Sabayon Linux, not in the host OS.

Setup a Guest OS

Setting the Guest OS up, is a case of following the Wizard, which is very intuitive.

1) Open VirtualBox

2) Click on New

3) Click on Next

4) Add a name for your OS (Lets assume you are installing WinXP) so enter Windows XP

5) Choose the OS Type from the drop down menu (Windows XP)

6) Click Next

7) Set your base memory size, (as a rule of thumb, never set this to more than half the host machines actual memory, otherwise the host grinds to a halt)

8) Click Next

9) This will take you to the hard disk allocation page, where on a new install you will need to click on New and launch another Wizard,

10) Virtual Disk image type, set this to Dynamically expanding image

11) Click Next

12) Set the image name to WinXP and the Image size to something over 4Gb

13) Click Next

14) A Summary will display, click finish

15) This will take you back to the Virtual Hard disk page, where you will be able to select the WinXP hard disk from the drop down menu

16) Click Next

17) Click on Finish

18) This will take you back to the Main Virtualbox interface.

To Launch the New system click on it once, and click on start. and the Virtual system will start to load, however with no CD in the CD Rom the system will probably stop when it looks for an OS.

You can load the Guest OS either from the CD-ROM, or from an ISO image, which is setup via the Settings option, when the Virtual machine is powered down.

Guest Additions

Now if you are using Virtualbox to run Windows XP as the guest OS, it is worthwhile loading the Guest Additions

The Guest additions allow you to do some really funky stuff, like have the mouse pointer work across both guest and host applications: Better Video drivers, and Seamless integration.

In the “Devices” menu in the virtual machine’s menu bar, VirtualBox has a handy menu item named “Install guest additions”, which will automatically bring up the Additions in your VM window.

If you prefer to mount the additions manually, you can perform the following steps:

1. Start the virtual machine where you have installed a Windows guest operating system.

2. Select “Mount CD/DVD-ROM” from the “Devices” menu in the virtual machine’s menu bar and then “CD/DVD-ROM image”. This brings up the Virtual Disk Man- ager.

3. In the Virtual Disk Manager, press the “Add” button and browse your host file system for the VBoxGuestAdditions.iso file:

• On a Linux host, you can find this file in the additions folder under where you installed VirtualBox (normally /opt/VirtualBox-1.5.0).

4. Back in the Virtual Disk Manager, select that ISO file and press the “Select” but- ton. This will mount the ISO file and present it to your Windows guest as a CD-ROM.

Once you have rebooted the Guest System, you can click on Machine -> Seamless mode and the apps you launch in the Guest OS, will behave no in a window, but actually on your desktop environment.

v00d00