VirtualBox: Difference between revisions

From Edgar BV Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Sun virtualbox
Oracle / Sun virtualbox


/etc/apt/sources.list
/etc/apt/sources.list
Line 6: Line 6:
package: virtualbox-3.2
package: virtualbox-3.2


adding shared directories:
you need the linux-headers (linux-headers-2.6-linux-flavor) and dkms package installed


NB you need the linux-headers-2.6-amd64, gcc, make and xorg packages (and possibly build-essential) installed. It's ok if the window system drivers fails.
The Debian package is called virtualbox-ose (open source edition)


The guest-additions are to be installed in the virtual machine.
From version 4 you also need to install the virtualbox extenstion package too.
= Installing Extension pack =
This goes on the physical machine.
Download this from https://www.virtualbox.org/wiki/Downloads
Then:
<pre>
BoxManage extpack install filename
</pre>
= Installing guest additions =
These go on the virtual machines.
NB you need the linux-headers-2.6-amd64, gcc, make and xorg dkms virtualbox-guest-additions-iso lxde (or other window manager) packages (and possibly build-essential and module-assistant) installed. It's ok if the window system drivers fails.
cd /usr/share/virtualbox
mount ./VBoxGuestAdditions.iso /mnt
/mnt/VBoxLinuxAdditions.run
Make sure that in Virtualbox Devices -> Shared Clipboard is set to bidirectional
Copy / paste from host to guest will only work in a full X11 environment, not in the terminal (also not with gdm, which allows you to copy and paste within the terminal)
== old ==
- Install required packages with apt-get install build-essential module-assistant;
- Install required packages with apt-get install build-essential module-assistant;
- Configure your system for building kernel modules by running m-a prepare;
- Configure your system for building kernel modules by running m-a prepare;
Line 16: Line 49:


or bash VBoxLinuxAddition-adm64.run
or bash VBoxLinuxAddition-adm64.run
= adding shared directories: =


mount -t vboxsf sharename /mountpoint/
mount -t vboxsf sharename /mountpoint/
Line 25: Line 60:
sharename /mount/point    vboxsf  defaults        0      0
sharename /mount/point    vboxsf  defaults        0      0


Switching consoles
= 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.
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.
Line 37: Line 72:
http://vboxtool.sourceforge.net/
http://vboxtool.sourceforge.net/


Changing the UUID of an image:
= Changing the UUID of an image: =


VBoxManage internalcommands sethduuid genericmachine.vdi
VBoxManage internalcommands sethduuid genericmachine.vdi


Copying an image to a new image to use:
Copying an image to a new image to use:
= Setting up VRDP / Remote Desktop =
VBoxManage modifyvm "VM name" --vrdpport 5000
NB every server needs a different port
To get into the VRDP use mstsc.exe / Remote Desktop Connection.
Connect to the IP-of-physical-server:PORT (So not the IP of the VM)
= Starting / stopping a vbox: =
Add to start in /etc/init.d/vboxdrv
<pre>
VBoxManage startvm EdgarGhost --type headless --type vrdp
</pre>
and to the stop part of the script
<pre>
VBoxManage controlvm $1 poweroff
</pre>
made a stop/start script for vbox machines sometime ago, ez to
stop/start via cmd line
<pre>
host-0001:~# cat start-vbox.sh
VBoxManage startvm $1 --type vrdp
host-0001:~# cat stop-vbox.sh
VBoxManage controlvm $1 poweroff
</pre>
e.g.
<pre>
stop-vbox.sh esuck
start-vbox.sh esuck
</pre>
--type vrdp is necessary if you want the VM to also open an RDP console!
Remember to give each vm in the configuration gui a different port!
= To make it run fullscreen: =
<right ctrl>+<F>
= NIC settings =
The network cards need to be bridged adapters and PCnet-FAST III

Latest revision as of 20:14, 18 January 2017

Oracle / Sun virtualbox

/etc/apt/sources.list deb http://download.virtualbox.org/virtualbox/debian lenny non-free

package: virtualbox-3.2

you need the linux-headers (linux-headers-2.6-linux-flavor) and dkms package installed

The Debian package is called virtualbox-ose (open source edition)

The guest-additions are to be installed in the virtual machine.

From version 4 you also need to install the virtualbox extenstion package too.

Installing Extension pack

This goes on the physical machine.

Download this from https://www.virtualbox.org/wiki/Downloads

Then:

BoxManage extpack install filename


Installing guest additions

These go on the virtual machines.

NB you need the linux-headers-2.6-amd64, gcc, make and xorg dkms virtualbox-guest-additions-iso lxde (or other window manager) packages (and possibly build-essential and module-assistant) installed. It's ok if the window system drivers fails.

cd /usr/share/virtualbox

mount ./VBoxGuestAdditions.iso /mnt

/mnt/VBoxLinuxAdditions.run

Make sure that in Virtualbox Devices -> Shared Clipboard is set to bidirectional

Copy / paste from host to guest will only work in a full X11 environment, not in the terminal (also not with gdm, which allows you to copy and paste within the terminal)

old

- Install required packages with apt-get install build-essential module-assistant; - Configure your system for building kernel modules by running m-a prepare; - Click on Install Guest Additions… from the Devices menu, then run mount /media/cdrom. - Run sh /media/cdrom/VBoxLinuxAdditions.run, and follow the instructions on screen.

or bash VBoxLinuxAddition-adm64.run

adding shared directories:

mount -t vboxsf sharename /mountpoint/

(nb it's not 'fs' it's 'sf')

to mount throug fstab it's

sharename /mount/point vboxsf defaults 0 0

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. (is normally right ctrl)

This also works for ctrl-alt-del and ctrl-alt-backspace

vobxtool to start virtual machines headlessly on PM startup

http://vboxtool.sourceforge.net/

Changing the UUID of an image:

VBoxManage internalcommands sethduuid genericmachine.vdi

Copying an image to a new image to use:

Setting up VRDP / Remote Desktop

VBoxManage modifyvm "VM name" --vrdpport 5000

NB every server needs a different port

To get into the VRDP use mstsc.exe / Remote Desktop Connection.

Connect to the IP-of-physical-server:PORT (So not the IP of the VM)

Starting / stopping a vbox:

Add to start in /etc/init.d/vboxdrv

VBoxManage startvm EdgarGhost --type headless --type vrdp

and to the stop part of the script

VBoxManage controlvm $1 poweroff

made a stop/start script for vbox machines sometime ago, ez to stop/start via cmd line

host-0001:~# cat start-vbox.sh
VBoxManage startvm $1 --type vrdp

host-0001:~# cat stop-vbox.sh
VBoxManage controlvm $1 poweroff

e.g.

stop-vbox.sh esuck
start-vbox.sh esuck

--type vrdp is necessary if you want the VM to also open an RDP console!

Remember to give each vm in the configuration gui a different port!

To make it run fullscreen:

<right ctrl>+<F>

NIC settings

The network cards need to be bridged adapters and PCnet-FAST III