UbuntuTrusty:InstallationVirtualbox

De Wiki Fred
Aller à : navigation, rechercher
Installation dans VirtualBox


Avant de commencer



Installation


Si l'interface réseau de la machine virtuelle est NAT, cette machine ne sera pas accessible depuis l'hôte. Pour qu'elle le soit il faut activer une deuxième carte réseau avec une interface Réseau privé hôte avant d'installer la machine virtuelle. Vb interfaces.jpg
 


Configuration


Activer toutes les interfaces réseau


Si une interface Réseau privé hôte est présente en plus de l'interface NAT, il faut l'ajouter


  • Editer le fichier /etc/network/interfaces et ajouter
auto eth1
iface eth1 inet dhcp
  • Démarrer l'interface
ifup eth1


Affichage de l'adresse IP avant le login


Lors de son démarrage, Ubuntu affiche le contenue du fichier /etc/issue juste avant le login. L'adresse IP du serveur peut y être ajoutée dynamiquement lors de chaque démarrage.


  • Sauvegarder le message d'origine
cp /etc/issue /etc/issue-standard
  • Créer /usr/local/bin/get-ip-address contenant
/sbin/ifconfig | grep "inet addr" | grep -v "127.0.0.1" | awk '{ print $2 }' | awk -F: '{ print $2 }'
  • Rendre le script /usr/local/bin/get-ip-address exécutable
chmod u+x /usr/local/bin/get-ip-address
  • Créer /etc/network/if-up.d/show-ip-address contenant
#!/bin/sh
if [ "$METHOD" = loopback ]; then
    exit 0
fi

if [ "$MODE" != start ]; then
    exit 0
fi

cp /etc/issue-standard /etc/issue
/usr/local/bin/get-ip-address >> /etc/issue
echo "" >> /etc/issue
  • Rendre le script /etc/network/if-up.d/show-ip-address exécutable
chmod u+x /etc/network/if-up.d/show-ip-address
  • Redémarrer
VirtualBox Ubuntu Trusty 07 06 2016 09 52 46.png
VirtualBox Ubuntu 14.04 x64 Server 07 06 2016 11 28 57.png


Installation des VirtualBox Guest Additions


  • Dans le menu Périphériques, choisir Insérer l'image CD des Additions Invité
  • sudo mount /dev/cdrom /media/cdrom
    
  • sudo apt-get install -y dkms build-essential linux-headers-generic linux-headers-$(uname -r)
    
  • sudo /media/cdrom/VBoxLinuxAdditions.run
    

Modification de la résolution


Par défaut, Ubuntu va démarrer avec une résolution de 640 x 480 x 32.

  • Démarrer le console grub : {{#switch:c

| caps lock = Caps Lock | caps lock = Caps Lock | shift = Shift | shift = Shift | enter = Enter | enter = Enter | cmd = Cmd | cmd | cmd = Cmd | command = Command | command | command = Command | opt = Opt | opt | opt = Opt | option = Option | option key | option | option = Option | tab = Tab | tab = Tab | backspace = ← Backspace | backspace = ← Backspace | win = Win | win | win = Win | menu = Menu | menu = Menu | up = ↑ | up = | down = ↓ | down = | left = ← | left = | right = → | right = | * | asterisk = * | # | hash = # | # = # | : | colon = : | [[:]] = : | pipe = | | [[|]] = | | ; | semicolon = ; | ; = ; | equals = =

| l-up | l up = L↑ | l-down | l down = L↓ | l-left | l left = L← | l-right | l right = L→ | l-ne | l ne = L↗ | l-se | l se = L↘ | l-nw | l nw = L↖ | l-sw | l sw = L↙

| r-up | r up = R↑ | r-down | r down = R↓ | r-left | r left = R← | r-right | r right = R→ | r-ne | r ne = R↗ | r-se | r se = R↘ | r-nw | r nw = R↖ | r-sw | r sw = R↙

| ps x | ex = × | ps c | circle = | ps s | square = | ps t | triangle =

| c-up | c up = C↑ | c-down | c down = C↓ | c-left | c left = C← | c-right | c right = C→ | c-ne | c ne = C↗ | c-se | c se = C↘ | c-nw | c nw = C↖ | c-sw | c sw = C↙

| #default = c }}{{#if:|+{{#switch:{{{2}}} | caps lock = Caps Lock | caps lock = Caps Lock | shift = Shift | shift = Shift | enter = Enter | enter = Enter | cmd = Cmd | cmd | cmd = Cmd | command = Command | command | command = Command | opt = Opt | opt | opt = Opt | option = Option | option key | option | option = Option | tab = Tab | tab = Tab | backspace = ← Backspace | backspace = ← Backspace | win = Win | win | win = Win | menu = Menu | menu = Menu | up = ↑ | up = | down = ↓ | down = | left = ← | left = | right = → | right = | * | asterisk = * | # | hash = # | # = # | : | colon = : | [[:]] = : | pipe = | | [[|]] = | | ; | semicolon = ; | ; = ; | equals = =

| l-up | l up = L↑ | l-down | l down = L↓ | l-left | l left = L← | l-right | l right = L→ | l-ne | l ne = L↗ | l-se | l se = L↘ | l-nw | l nw = L↖ | l-sw | l sw = L↙

| r-up | r up = R↑ | r-down | r down = R↓ | r-left | r left = R← | r-right | r right = R→ | r-ne | r ne = R↗ | r-se | r se = R↘ | r-nw | r nw = R↖ | r-sw | r sw = R↙

| ps x | ex = × | ps c | circle = | ps s | square = | ps t | triangle =

| c-up | c up = C↑ | c-down | c down = C↓ | c-left | c left = C← | c-right | c right = C→ | c-ne | c ne = C↗ | c-se | c se = C↘ | c-nw | c nw = C↖ | c-sw | c sw = C↙

| #default = {{{2}}} }}}}{{#if:|+{{#switch:{{{3}}} | caps lock = Caps Lock | caps lock = Caps Lock | shift = Shift | shift = Shift | enter = Enter | enter = Enter | cmd = Cmd | cmd | cmd = Cmd | command = Command | command | command = Command | opt = Opt | opt | opt = Opt | option = Option | option key | option | option = Option | tab = Tab | tab = Tab | backspace = ← Backspace | backspace = ← Backspace | win = Win | win | win = Win | menu = Menu | menu = Menu | up = ↑ | up = | down = ↓ | down = | left = ← | left = | right = → | right = | * | asterisk = * | # | hash = # | # = # | : | colon = : | [[:]] = : | pipe = | | [[|]] = | | ; | semicolon = ; | ; = ; | equals = =

| l-up | l up = L↑ | l-down | l down = L↓ | l-left | l left = L← | l-right | l right = L→ | l-ne | l ne = L↗ | l-se | l se = L↘ | l-nw | l nw = L↖ | l-sw | l sw = L↙

| r-up | r up = R↑ | r-down | r down = R↓ | r-left | r left = R← | r-right | r right = R→ | r-ne | r ne = R↗ | r-se | r se = R↘ | r-nw | r nw = R↖ | r-sw | r sw = R↙

| ps x | ex = × | ps c | circle = | ps s | square = | ps t | triangle =

| c-up | c up = C↑ | c-down | c down = C↓ | c-left | c left = C← | c-right | c right = C→ | c-ne | c ne = C↗ | c-se | c se = C↘ | c-nw | c nw = C↖ | c-sw | c sw = C↙

| #default = {{{3}}} }}}}{{#if:|+{{#switch:{{{4}}} | caps lock = Caps Lock | caps lock = Caps Lock | shift = Shift | shift = Shift | enter = Enter | enter = Enter | cmd = Cmd | cmd | cmd = Cmd | command = Command | command | command = Command | opt = Opt | opt | opt = Opt | option = Option | option key | option | option = Option | tab = Tab | tab = Tab | backspace = ← Backspace | backspace = ← Backspace | win = Win | win | win = Win | menu = Menu | menu = Menu | up = ↑ | up = | down = ↓ | down = | left = ← | left = | right = → | right = | * | asterisk = * | # | hash = # | # = # | : | colon = : | [[:]] = : | pipe = | | [[|]] = | | ; | semicolon = ; | ; = ; | equals = =

| l-up | l up = L↑ | l-down | l down = L↓ | l-left | l left = L← | l-right | l right = L→ | l-ne | l ne = L↗ | l-se | l se = L↘ | l-nw | l nw = L↖ | l-sw | l sw = L↙

| r-up | r up = R↑ | r-down | r down = R↓ | r-left | r left = R← | r-right | r right = R→ | r-ne | r ne = R↗ | r-se | r se = R↘ | r-nw | r nw = R↖ | r-sw | r sw = R↙

| ps x | ex = × | ps c | circle = | ps s | square = | ps t | triangle =

| c-up | c up = C↑ | c-down | c down = C↓ | c-left | c left = C← | c-right | c right = C→ | c-ne | c ne = C↗ | c-se | c se = C↘ | c-nw | c nw = C↖ | c-sw | c sw = C↙

| #default = {{{4}}} }}}}{{#if:|+{{#switch:{{{5}}} | caps lock = Caps Lock | caps lock = Caps Lock | shift = Shift | shift = Shift | enter = Enter | enter = Enter | cmd = Cmd | cmd | cmd = Cmd | command = Command | command | command = Command | opt = Opt | opt | opt = Opt | option = Option | option key | option | option = Option | tab = Tab | tab = Tab | backspace = ← Backspace | backspace = ← Backspace | win = Win | win | win = Win | menu = Menu | menu = Menu | up = ↑ | up = | down = ↓ | down = | left = ← | left = | right = → | right = | * | asterisk = * | # | hash = # | # = # | : | colon = : | [[:]] = : | pipe = | | [[|]] = | | ; | semicolon = ; | ; = ; | equals = =

| l-up | l up = L↑ | l-down | l down = L↓ | l-left | l left = L← | l-right | l right = L→ | l-ne | l ne = L↗ | l-se | l se = L↘ | l-nw | l nw = L↖ | l-sw | l sw = L↙

| r-up | r up = R↑ | r-down | r down = R↓ | r-left | r left = R← | r-right | r right = R→ | r-ne | r ne = R↗ | r-se | r se = R↘ | r-nw | r nw = R↖ | r-sw | r sw = R↙

| ps x | ex = × | ps c | circle = | ps s | square = | ps t | triangle =

| c-up | c up = C↑ | c-down | c down = C↓ | c-left | c left = C← | c-right | c right = C→ | c-ne | c ne = C↗ | c-se | c se = C↘ | c-nw | c nw = C↖ | c-sw | c sw = C↙

| #default = {{{5}}} }}}}{{#if:|+{{#switch:{{{6}}} | caps lock = Caps Lock | caps lock = Caps Lock | shift = Shift | shift = Shift | enter = Enter | enter = Enter | cmd = Cmd | cmd | cmd = Cmd | command = Command | command | command = Command | opt = Opt | opt | opt = Opt | option = Option | option key | option | option = Option | tab = Tab | tab = Tab | backspace = ← Backspace | backspace = ← Backspace | win = Win | win | win = Win | menu = Menu | menu = Menu | up = ↑ | up = | down = ↓ | down = | left = ← | left = | right = → | right = | * | asterisk = * | # | hash = # | # = # | : | colon = : | [[:]] = : | pipe = | | [[|]] = | | ; | semicolon = ; | ; = ; | equals = =

| l-up | l up = L↑ | l-down | l down = L↓ | l-left | l left = L← | l-right | l right = L→ | l-ne | l ne = L↗ | l-se | l se = L↘ | l-nw | l nw = L↖ | l-sw | l sw = L↙

| r-up | r up = R↑ | r-down | r down = R↓ | r-left | r left = R← | r-right | r right = R→ | r-ne | r ne = R↗ | r-se | r se = R↘ | r-nw | r nw = R↖ | r-sw | r sw = R↙

| ps x | ex = × | ps c | circle = | ps s | square = | ps t | triangle =

| c-up | c up = C↑ | c-down | c down = C↓ | c-left | c left = C← | c-right | c right = C→ | c-ne | c ne = C↗ | c-se | c se = C↘ | c-nw | c nw = C↖ | c-sw | c sw = C↙

| #default = {{{6}}} }}}}{{#if:|+{{#switch:{{{7}}} | caps lock = Caps Lock | caps lock = Caps Lock | shift = Shift | shift = Shift | enter = Enter | enter = Enter | cmd = Cmd | cmd | cmd = Cmd | command = Command | command | command = Command | opt = Opt | opt | opt = Opt | option = Option | option key | option | option = Option | tab = Tab | tab = Tab | backspace = ← Backspace | backspace = ← Backspace | win = Win | win | win = Win | menu = Menu | menu = Menu | up = ↑ | up = | down = ↓ | down = | left = ← | left = | right = → | right = | * | asterisk = * | # | hash = # | # = # | : | colon = : | [[:]] = : | pipe = | | [[|]] = | | ; | semicolon = ; | ; = ; | equals = =

| l-up | l up = L↑ | l-down | l down = L↓ | l-left | l left = L← | l-right | l right = L→ | l-ne | l ne = L↗ | l-se | l se = L↘ | l-nw | l nw = L↖ | l-sw | l sw = L↙

| r-up | r up = R↑ | r-down | r down = R↓ | r-left | r left = R← | r-right | r right = R→ | r-ne | r ne = R↗ | r-se | r se = R↘ | r-nw | r nw = R↖ | r-sw | r sw = R↙

| ps x | ex = × | ps c | circle = | ps s | square = | ps t | triangle =

| c-up | c up = C↑ | c-down | c down = C↓ | c-left | c left = C← | c-right | c right = C→ | c-ne | c ne = C↗ | c-se | c se = C↘ | c-nw | c nw = C↖ | c-sw | c sw = C↙

| #default = {{{7}}} }}}}{{#if:|+{{#switch:{{{8}}} | caps lock = Caps Lock | caps lock = Caps Lock | shift = Shift | shift = Shift | enter = Enter | enter = Enter | cmd = Cmd | cmd | cmd = Cmd | command = Command | command | command = Command | opt = Opt | opt | opt = Opt | option = Option | option key | option | option = Option | tab = Tab | tab = Tab | backspace = ← Backspace | backspace = ← Backspace | win = Win | win | win = Win | menu = Menu | menu = Menu | up = ↑ | up = | down = ↓ | down = | left = ← | left = | right = → | right = | * | asterisk = * | # | hash = # | # = # | : | colon = : | [[:]] = : | pipe = | | [[|]] = | | ; | semicolon = ; | ; = ; | equals = =

| l-up | l up = L↑ | l-down | l down = L↓ | l-left | l left = L← | l-right | l right = L→ | l-ne | l ne = L↗ | l-se | l se = L↘ | l-nw | l nw = L↖ | l-sw | l sw = L↙

| r-up | r up = R↑ | r-down | r down = R↓ | r-left | r left = R← | r-right | r right = R→ | r-ne | r ne = R↗ | r-se | r se = R↘ | r-nw | r nw = R↖ | r-sw | r sw = R↙

| ps x | ex = × | ps c | circle = | ps s | square = | ps t | triangle =

| c-up | c up = C↑ | c-down | c down = C↓ | c-left | c left = C← | c-right | c right = C→ | c-ne | c ne = C↗ | c-se | c se = C↘ | c-nw | c nw = C↖ | c-sw | c sw = C↙

| #default = {{{8}}} }}}}{{#if:|+{{#switch:{{{9}}} | caps lock = Caps Lock | caps lock = Caps Lock | shift = Shift | shift = Shift | enter = Enter | enter = Enter | cmd = Cmd | cmd | cmd = Cmd | command = Command | command | command = Command | opt = Opt | opt | opt = Opt | option = Option | option key | option | option = Option | tab = Tab | tab = Tab | backspace = ← Backspace | backspace = ← Backspace | win = Win | win | win = Win | menu = Menu | menu = Menu | up = ↑ | up = | down = ↓ | down = | left = ← | left = | right = → | right = | * | asterisk = * | # | hash = # | # = # | : | colon = : | [[:]] = : | pipe = | | [[|]] = | | ; | semicolon = ; | ; = ; | equals = =

| l-up | l up = L↑ | l-down | l down = L↓ | l-left | l left = L← | l-right | l right = L→ | l-ne | l ne = L↗ | l-se | l se = L↘ | l-nw | l nw = L↖ | l-sw | l sw = L↙

| r-up | r up = R↑ | r-down | r down = R↓ | r-left | r left = R← | r-right | r right = R→ | r-ne | r ne = R↗ | r-se | r se = R↘ | r-nw | r nw = R↖ | r-sw | r sw = R↙

| ps x | ex = × | ps c | circle = | ps s | square = | ps t | triangle =

| c-up | c up = C↑ | c-down | c down = C↓ | c-left | c left = C← | c-right | c right = C→ | c-ne | c ne = C↗ | c-se | c se = C↘ | c-nw | c nw = C↖ | c-sw | c sw = C↙

| #default = {{{9}}} }}}}{{#if:|+{{#switch:{{{10}}} | caps lock = Caps Lock | caps lock = Caps Lock | shift = Shift | shift = Shift | enter = Enter | enter = Enter | cmd = Cmd | cmd | cmd = Cmd | command = Command | command | command = Command | opt = Opt | opt | opt = Opt | option = Option | option key | option | option = Option | tab = Tab | tab = Tab | backspace = ← Backspace | backspace = ← Backspace | win = Win | win | win = Win | menu = Menu | menu = Menu | up = ↑ | up = | down = ↓ | down = | left = ← | left = | right = → | right = | * | asterisk = * | # | hash = # | # = # | : | colon = : | [[:]] = : | pipe = | | [[|]] = | | ; | semicolon = ; | ; = ; | equals = =

| l-up | l up = L↑ | l-down | l down = L↓ | l-left | l left = L← | l-right | l right = L→ | l-ne | l ne = L↗ | l-se | l se = L↘ | l-nw | l nw = L↖ | l-sw | l sw = L↙

| r-up | r up = R↑ | r-down | r down = R↓ | r-left | r left = R← | r-right | r right = R→ | r-ne | r ne = R↗ | r-se | r se = R↘ | r-nw | r nw = R↖ | r-sw | r sw = R↙

| ps x | ex = × | ps c | circle = | ps s | square = | ps t | triangle =

| c-up | c up = C↑ | c-down | c down = C↓ | c-left | c left = C← | c-right | c right = C→ | c-ne | c ne = C↗ | c-se | c se = C↘ | c-nw | c nw = C↖ | c-sw | c sw = C↙

| #default = {{{10}}} }}}}{{#if:|}} quand grub apparaît

  • vbeinfo
    
  • Choisir dans le liste une résolution qui convient. Par exemple 1152 x 864 x 32
  • Redémarrer en mode normal
reboot
  • Editer le fichier /etc/default/grub
sudo nano /etc/default/grub
  • Dé-commenter la ligne GRUB_GFXMODE=640x480
  • Remplacer 640x480 par la résolution choisie 1152x864x32
  • Editer le fichier /etc/grub.d/00_header
sudo nano /etc/grub.d/00_header
  • Repérer la ligne if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=auto ; fi
  • Remplacer auto par 1152 x 864 x 32
  • sudo update-grub2 && sudo shutdown -r now
    

Déactivation de l'écran de veille


  • Editer le fichier /etc/default/grub
sudo nano /etc/default/grub
  • Repérer la ligne GRUB_CMDLINE_LINUX_DEFAULT= et y ajouter consoleblank=0. Par exemple :
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash consoleblank=0"
  • sudo update-grub2 && sudo shutdown -r now
    

Desktop

Installation des VirtualBox Guest Additions


Les VirtualBox Guest Additions permettent de :

  • Ajouter à la résolution de 640x480 une résolution de 1024x768.
  • Ajouter manuellement d'autres résolutions (Voir ci-dessous).
  • Adapter automatiquement la résolution en fonction de la taille de la fenêtre.
  • Faire du copier/coller et glisser/déposer entre/de la machine virtuelle et/vers l'hôte (voir remarque).


Installation :

  • Démarrer la machine virtuelle Ubuntu et ouvrir une session
  • Dans le menu Périphériques, choisir Insérer l'image CD des Additions Invité et ensuite Run
  • Redémarrer la machine


Si le copier/coller ou glisser/déposer ne fonctionne pas vérifier, dans les options de la machine virtuelle, que
les options Presse-papier partagé et Glisser-Déposer sont bien sur Bidirectionnel :
Extension pack2.png
 


Post-Installation


piix4_smbus 00:00:07.0: SMBus base address uninitialized - upgrade BIOS or use force_addr=0xaddr


Si le message piix4_smbus 00:00:07.0: SMBus base address uninitialized - upgrade BIOS or use force_addr=0xaddr apparaît au démarrage :

  • Editer le fichier /etc/modprobe.d/blacklist.conf et ajouter à la fin
blacklist i2c_piix4


Ajouter une résolution d'écran non disponible


  • Déterminer le nom de la sortie
xrandr

Cette commande donne comme résultat :

Screen 0: minimum 64 x 64, current 1024 x 768, maximum 16384 x 16384
VBOX0 connected primary 1024x768+0+0 0mm x 0mm
   1024x768       60.0*+
   800x600        60.0  
   640x480        60.0

Le nom de la sortie est VBOX0

  • Déterminer le modeline de la résolution choisie. Pour une résolution de 1240x920 :
cvt 1240 920

Cette commande donne comme résultat :

# 1240x920 59.86 Hz (CVT) hsync: 57.16 kHz; pclk: 93.75 MHz
Modeline "1240x920_60.00"   93.75  1240 1312 1440 1640  920 923 933 955 -hsync +vsync

Le modeline de cette résolution est 93.75 1240 1312 1440 1640 920 923 933 955 -hsync +vsync

  • Créer un script /usr/bin/lightdmxrandr.sh
1 xrandr --newmode "1240x920"  93.75  1240 1312 1440 1640  920 923 933 955 -hsync +vsync
2 xrandr --addmode VBOX0 1240x920
  • Rendre le script /usr/bin/lightdmxrandr.sh exécutable
sudo chmod u+x /usr/bin/lightdmxrandr.sh
  • Editer le fichier /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf et y ajouter
session-setup-script=/usr/bin/lightdmxrandr.sh
  • Redémarrer
  • Choisir la résolution créée