10343
Comment: Sun buy Innotek
|
9974
fix links
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
## ## hints for wiki contributors about VirtualBox: ## - write hints/guidelines here. ## ## Remember, it's important (for search engines) that title actually ## contains words relevant to the page content. ("introduction" don't help) ## ||<tablewidth="100%"style="border: 0px hidden ;">~-Translation(s): [:German/VirtualBox:Deutsch] - [:French/VirtualBox:Français] - [:Spanish/VirtualBox:Español] - [:Dutch/VirtualBox:Nederlands] - [:Polish/VirtualBox:Polski] - [:PortugueseBR/VirtualBox:Português - Brasileiro] - [:Russian/VirtualBox:Русский]-~ ||<style="border: 0px hidden ; text-align: right;"> (!) ["/Discussion"] || |
||<tablewidth="100%"style="border: 0px hidden ;">~-Translation(s): [:Spanish/VirtualBox:Español]-~ ||<style="border: 0px hidden ; text-align: right;"> (!) ["/Discussion"] || |
Line 17: | Line 10: |
Line 18: | Line 12: |
= Installation = Currently ''(2008/01/01)'', VirtualBox is not supported natively by ["Etch"], the 4.0 version of Debian. To install it, you can use different methods: * Using Debian/Etch-backports repository * Using Debian/Testing repository |
== Installation == Currently ''(2008/01/01)'', VirtualBox is not supported natively by [:DebianEtch:Etch], the 4.0 version of Debian. To install it, you can use different methods: * Using Debian/Etch's ["Backports"] repository * Using [:DebianTesting"] repository |
Line 25: | Line 19: |
== Debian/Etch-backports == * Configure [:Backports:Debian/Etch-backports] |
=== Debian/Etch-backports === * Configure Debian/Etch [:Backports:backports] |
Line 47: | Line 40: |
{{{ KDE > System > VirtualBox OSE Gnome > Applications > System tools > VirtualBox OSE }}} |
In KDE, go to menu KDE > System > VirtualBox OSE ''or'' In Gnome, goto menu Gnome > Applications > System tools > VirtualBox OSE |
Line 52: | Line 45: |
== Debian/Testing == |
=== Debian/Testing === |
Line 63: | Line 55: |
= Errors = == 32-bit userland with x64_64 kernel == |
== Errors == === 32-bit userland with x64_64 kernel === |
Line 67: | Line 59: |
== -1909 VERR VM DRIVER NOT ACCESSIBLE == | === -1909 VERR VM DRIVER NOT ACCESSIBLE === |
Line 94: | Line 86: |
Line 95: | Line 88: |
= Tips & tricks = == Switching consoles == |
== Tips & tricks == === Switching consoles === |
Line 108: | Line 100: |
== Setting up bridged networking for VirtualBox == | === Setting up bridged networking for VirtualBox === |
Line 113: | Line 105: |
=== Preparation === | ==== Preparation ==== |
Line 141: | Line 133: |
=== Configuring the VirtualBox VM === | ==== Configuring the VirtualBox VM ==== |
Line 148: | Line 140: |
==== Static interfaces ==== | ===== Static interfaces ===== |
Line 164: | Line 156: |
==== Dynamic interfaces (on demand) ==== | ===== Dynamic interfaces (on demand) ===== |
Line 198: | Line 191: |
== How to remotely start virtual machines using vnc == | === How to remotely start virtual machines using vnc === |
Line 217: | Line 210: |
= External Links = | == External Links == |
Line 219: | Line 213: |
---- . CategorySystemVirtualization |
* Alternative SystemVirtualization tools. |
?TableOfContents(2)
?Anchor(install)
Installation
Currently (2008/01/01), VirtualBox is not supported natively by [:DebianEtch:Etch], the 4.0 version of Debian. To install it, you can use different methods:
- Using Debian/Etch's ["Backports"] repository
Using [:DebianTesting"] repository
?Anchor(install-backport)
Debian/Etch-backports
Configure Debian/Etch [:Backports:backports]
Install these packages: virtualbox-ose virtualbox-ose-source
Compile virtualbox kernel module (as ["root"])
# cd /usr/src # tar xvjf virtualbox-ose.tar.bz2 # cd modules/virtualbox-ose # make # make install # modprobe vboxdrv # lsmod | grep vbox vboxdrv 55344 0
Or simply use module-assistant (as ["root"])
# module-assistant auto-install virtualbox-ose # modprobe vboxdrv # lsmod | grep vbox vboxdrv 55344 0
Start VirtualBox:
In KDE, go to menu KDE > System > VirtualBox OSE
or
In Gnome, goto menu Gnome > Applications > System tools > VirtualBox OSE
?Anchor(install-testing)
Debian/Testing
Testing repository contains some precompiled kernel module. So you don't need to compile it like previous method. Except that, it's the same mechanism. Be carreful, using testing repository could break your system. Note that virtualbox need to update libc6 and linux-image-2.6
Experience
Legend :
= OK
= Failed
Who |
Kernel |
Disribution |
Package Version |
Status |
-- SalokineTerata ?DateTime(2008-01-01T19:52:09Z) |
2.6.22-6~bpo40+1 |
Debian/Etch-backports |
1.5.2-dfsg2-4~bpo40+1 |
|
Errors
32-bit userland with x64_64 kernel
It is know bug that VirtualBox does not work in such scenarios: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=456391
-1909 VERR VM DRIVER NOT ACCESSIBLE
attachment:error-1909-VERR_VM_DRIVER_NOT_ACCESSIBLE.png
Solution: Add your current user in the group vboxusers.
- Under KDE:
K > Configuration Center > System Administration > User Management
- Select your user and edit it
Go to Groups page
Select vboxusers group and validate
- Reconnect your session
- Under GNOME:
System > Administration > Users and Groups
Click on "Manage groups"
Select the vboxusers group and click "Properties"
- Check your username in the list and click "Ok"
- Logout and login again
- On the commandline
log as user root either by su or sudo (su [return] - <give root password> [return] OR sudo su [return])
Use the following command: adduser <youruser> vboxusers
- Logout and login again
You can verify if your are really member of this group with this command line:
# id MY_USER uid=1000(MY_USER) gid=1000(MY_USER) groupes=1000(MY_USER),8(mail),...127(vboxusers)
?Anchor(tips)
Tips & tricks
Switching consoles
The normal way to switch consoles in Linux is to use the ctrl-alt-Fx key combination. This does not work for a VirtualBox virtual machine (VM); it will switch consoles for the host system instead.
You should use <Host Key>-Fx instead, where <Host Key> is the key defined in File->Preferences->Input.
This also works for ctrl-alt-del and ctrl-alt-backspace
This is documented in the [http://www.virtualbox.org/download/UserManual.pdf ?VirtalBox user manual] in the section "Keyboard and mouse support in virtual machines", subsection "Typing special characters".
(An alternative method to switch between text consoles is to use alt-left and alt-right, but that does not work for graphical consoles like XOrg or DirectFB.)
Setting up bridged networking for VirtualBox
By default VirtualBox uses NAT for the network interfaces of virtual machines and use an internal DHCP server to obtain an IP address. This works well but the disadvantage is that the machine will not have an IP address visible outside the VM and so you cannot connect to it from the host system or from other systems.
By attaching the VM's interface to "Host Interface" and creating a bridge on the host system, the VM can be made visible on the local network. This also allows to do fun stuff like netbooting the VM (boot from LAN using PXE). It is comparable to the "bridged networking" option in VMWare.
Preparation
First install the package bridge-utils.
Next, change the network configuration of the host system so that the network interface becomes part of a bridge. Note that this requires restarting the network, so be careful when doing this on a remote system!
Change the file /etc/network/interfaces to look something like this:
# The loopback network interface auto lo iface lo inet loopback # An entry for eth0 is no longer needed #auto eth0 #iface eth0 inet dhcp # Create the bridge (with the regular IP address of the host) auto br0 iface br0 inet dhcp bridge_ports eth0 bridge_fd 2.5
In this example the bridge gets its IP address and configuration from DHCP. For static configuration see?BR/usr/share/doc/bridge-utils/README.Debian.gz
Restart the networking of the host system using:
# /etc/init.d/networking restart
After this brctl show should show the bridge and ifconfig should show the bridge has the host's IP address.
Configuring the VirtualBox VM
There are different ways the TAP interface for the VM can be created:
statically (before VirtualBox is even started)
- on demand (when a VM is being started)
See also the chapter on "Virtual networking" in the [http://www.virtualbox.org/download/UserManual.pdf ?VirtalBox user manual].
Static interfaces
In this case you only need to "define" an interface for use by a particular user once. All defined interfaces are "remembered" in the file /etc/vbox/interfaces and recreated by the VirtualBox init script every time the host system is booted.
Example to create an interface for a user:
# VBoxAddIF vbox0 <username> br0
You can of course create multiple interfaces per users, but all interfaces should have unique names.
To configure the VM to use static bridged networking, go to the "network" page of the VM's settings and change the following fields:
Attached to: Host Interface
Interface Name: vbox0
Setup Application: <empty>
Terminate Application: <empty>
Dynamic interfaces (on demand)
The example below shows the second method. In the example the name of the interface is hardcoded in the script. If you want to be able to create multiple interfaces, you'll have to adapt the script. Note that the script assumes you can execute the needed commands using sudo.
set -e IF=vbox0 BRIDGE=br0 case "$1" in up) # Create a TAP network device sudo VBoxTunctl -u $LOGNAME -t $IF >/dev/null 2>&1 # Bring it up (without IP address) sudo ifconfig $IF up # Add it to the bridge sudo brctl addif $BRIDGE $IF # Tell VirtualBox the name of the interface echo $IF ;; down) sudo VBoxTunctl -d $IF >/dev/null 2>&1 ;; esac
Save the script, for example as ~/.VirtualBox/bridge_setup. The script can be tested by running it from the command line. If successful, brctl show should show interface vbox0 added to the bridge.
To configure the VM to use dynamic bridged networking, go to the "network" page of the VM's settings and change the following fields:
Attached to: Host Interface
Interface Name: <empty>
Setup Application: ~/.VirtualBox/bridge_setup up
Terminate Application: ~/.VirtualBox/bridge_setup down
When the VM is started after that, the interface should be created automatically and the VM can be used just like it was a system connected directly to your local network.
How to remotely start virtual machines using vnc
Remote:
- log onto your remote box
- install tightvncserver
- launch it (you don't need a display), pick a password
- determine which port it is using, a way to do so:
- netstat -tap | grep vnc
- Let's say it's 5901
- unlog from there since the server forked in the background
Local:
- install xtightvncviewer
- create a ssh tunnel to your box:
- ssh -L 5901:localhost:5901 you@remote
- use it: (note there are two colons)
- xtightvncviewer localhost::5901
then VBoxManage startvm $yourvm &
- and start as many virtual machines as wanted.
External Links
http://www.virtualbox.org/download/UserManual.pdf Official User Manual
Alternative SystemVirtualization tools.