Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
omv:virtualbox [2015/11/11 16:50]
admin [Debian 7 Template]
omv:virtualbox [2015/11/12 17:47] (current)
admin [Debian 7 Template]
Line 15: Line 15:
  
 Access the PhpVirtualBox at **[[http://​192.168.1.34/​virtualbox/​]]** Access the PhpVirtualBox at **[[http://​192.168.1.34/​virtualbox/​]]**
 +
 +In case one needs to modify phpvirualbox configs, edit: //​**/​usr/​share/​phpvirtualbox/​config.php**//​ \\
 +AT LEAST set $username and $password for security!
  
 ===== VMs ===== ===== VMs =====
Line 70: Line 73:
 PROCEED TO DEBIAN INSTALLATION... PROCEED TO DEBIAN INSTALLATION...
  
-In case one needs to modify phpvirualbox configs, edit: //​**/​usr/​share/​phpvirtualbox/​config.php**//​ \\ +=== Set VM's static IP (vboxnet0) ===
-AT LEAST set $username and $password+
  
-=== Set VB static IP (vboxnet0) ===+For a general comprehension of **Network Options in VirtualBox** you can read [[http://​catlingmindswipe.blogspot.be/​2012/​06/​how-to-virtualbox-networking-part-two.html|this article]] that clears things up a little bit.
  
 To allow access from our OMV host to our VMs, we'll set a static IP for our template; THIS WILL HAVE TO BE UPDATED FOR EACH CLONE. To allow access from our OMV host to our VMs, we'll set a static IP for our template; THIS WILL HAVE TO BE UPDATED FOR EACH CLONE.
  
-What we experimented with the Oracle RDP Web Control (PhpVirtualBox Console) is that it was NOT POSSIBLE TO SEND the "​Ctrl"​ CHARACTER, nor "​esc",​ through the console, making it impossible to edit files this way. Thus we need another way to access the /​etc/​network/​interfaces file. We'll try to **mount the vdi** on our OMV host as [[http://​www.aossama.com/​mount-virtualbox-vdi-image-debian/​|described here]].+What we experimented with the Oracle RDP Web Control (PhpVirtualBox Console) is that it was NOT POSSIBLE TO SEND the "​Ctrl"​ CHARACTER, nor "​esc",​ through the console, making it impossible to edit files this way. Thus we need another way to access the /​etc/​network/​interfaces file. We'll try to **mount the vdi** on our OMV host as summarized [[:​vbox:​resize-vdi#​mount_a_vdi_to_the_host_system|summarized here]], ​[[http://​www.aossama.com/​mount-virtualbox-vdi-image-debian/​|and described here]].
  
-With the VM **stopped**:​ +=== Register our OMV rsa key ===
-<​code>​ +
-> apt-get install qemu-utils kpartx +
-> modprobe nbd +
-> qemu-nbd -c /dev/nbd0 /​path/​to/​file.vdi +
-> kpartx -a /dev/nbd0 +
-> mount /​dev/​mapper/​nbd0p1 /mnt +
-</​code>​+
  
-Now we can access files on the vdi: +Once the template is running, from the OMV system (the ~/.ssh/id_rsa.pub file should already exist):
-<​code>​ +
-> nano /mnt/etc/​network/​interfaces +
- +
-ADD: +
-# Static private LAN interface +
-auto eth1 +
-iface eth1 inet static +
-   ​address 172.30.30.XXX +
-   ​netmask 255.255.255.0 +
-   ​broadcast 172.30.30.255 +
-   ​network 172.30.30.0 +
-</​code>​+
  
-To UNMOUNT the vdi: 
 <​code>​ <​code>​
-umount /mnt +ssh-copy-id root@172.30.30.2
-> qemu-nbd -d /dev/nbd0+
 </​code>​ </​code>​
  
-=== Register our OMV rsa key ===+=== DNS resolution ​===
  
-Once the template is running, from the OMV system (the ~/​.ssh/​id_rsa.pub file should already exist):+Using the NAT Network seems not to let the guest VM access ​the host's DNS resolver, we need to modify the guest VM as followNote that **vboxmanage must be executed as vbox user**!
  
 <​code>​ <​code>​
-ssh-copy-id root@172.30.30.2+su vbox 
 +> vboxmanage list vm 
 +> vboxmanage modifyvm "​Debian-7.9-Wheezy"​ --natdnshostresolver1 on
 </​code>​ </​code>​
  
-=== Duplicate ​=== +=== Clone ===
- +
-We now have a Debian-7.9 template VM that we can duplicate as a base for other Debian 7 VMs: +
- +
-From the PhpVirtualBox Web GUI (with the template stopped):+
  
 +We now have a Debian-7.9 template VM that we can clone, from the PhpVirtualBox Web GUI (with the template stopped), as a base for other Debian 7 VMs.
  
 +On each clone, one will have to specify the VM's:
 +  * vboxnet0 IP: **/​etc/​network/​interfaces**
 +  * hostname: **/​etc/​hosts** + **/​etc/​hostname**