Create a separate virtual disk for the data, and explain how to mount it on the virtual machine.
Understand when and why the file
/etc/bash_completion.d/grub
appears in the folder
/etc/bash_completion.d/
. This config file creates warnings
(see https://askubuntu.com/questions/778439/have-command-not-found),
and I don’t need it since grub is not installed.
Share folder on host computer. Answer mail from Fernando Hayashi Sant Anna fhsantanna@yahoo.com.br about folder sharing not working because cannot install the virtualbox guest additions package.
Before starting the installation process, we recommend to download the following files
Virtualbox: https://www.virtualbox.org/wiki/Downloads
Ubuntu Desktop: current Ubuntu release is 22.04, but the installation procedure works on earlier versions (maybe some slight modifications)
Ubuntu releases can be found here : http://releases.ubuntu.com/releases/
The latest release tested was this one
RSAT has also been installed on VirtualBpx VMs with following releases
Open VirtualBox
In the Machine menu, select the New function.
Parameters
Name and Operating System (replace YYYY-MM by the curent year and month)
Check the option “Skip unattended installation”
Memory size: 2048 Mb (this can be modified afterwards).
Hard drive: Create a virtual hard drive now.
Hard drive file type: VMDK (Virtual Machine Disk).
I chose this option because it ensures a wider compatibility with other OS and Virtual Machine management systems.
Another potential advantage of VMDK is that it enables to split virtual disks into files <=2Gb, which is convenient to store them on FAT partitions. However, for the distribution I avoid to activate this option because it is simpler to put a single dwnloable file on the server.
Storage on physical hard drive
File location and size
name of virtual hard drive file: rsat-vb-YYYY-MM_hdd
max size of virtual hard drive: 18GB
Note: the size has to be larger than your real needs, because Ubuntu will automatically create some big partitions (/dev and /run/shm). Since we allow dynamical memory allocation, it is fine to set the max size to 18Gb, which will be grossly assigned as follows:
At this stage, the VM has been created and needs to be configured before installing the operating system.
Before configuring the virtual machine, we need to tell VirtualBox how it will enable your local virtual machines to interact with their host (the operating system of the machine on which the VM is running).
In the File menu
Click on Host-only Networks manager
Click on the “+” icon.
This creates a network vboxnet0.
Select this network, click on the toothed wheel icon (edit host-only network), and set the following options:
Adapter tab
DHCP Server tab
VirtualBox enables you to specify several adapters, each corresponding to one separate network acces (e.g. using an ethernet card + wi-fi connection). Note that you will have the possibility to modify the network settings later.
VirtualBox offers alternative ways to configure network communications between the virtual machine, the host machine, and the external network. To get more information about network settings:
We present here one possible way to configure your Virtual machine, but this should be adapted to the particular security/flexibility requirements of the network where the maching has to run.
The first network adapter is the safest: the only possible communication is from the host to the guest. This is sufficient to enable you to use the RSAT VM from your computer and only from there. Besides, your VM has no possibility to establish a connection to the external work.
We strongly recommend to specify a NAT as second adaptor, since this allows your VM to establish connections (browser, ssh) to the world outside the host machine (your computer).
BEWARE! If you activate the adaptor described below your VM will be visible from external computers in the same network as the host machine.
See information at: https://www.virtualbox.org/manual/ch06.html#network_bridged
If you are connected via Wi-Fi (wireless), you may need to set up advanced option for Wi-Fi connection.
Note: you can also activate a fourth adapter, for example to support both an ethernet card (Adapter 3) and a Wi-Fi connection (Adapter 4). This is particularly useful for laptop computers, whose network parameters vary from place to place.
Once the settings have been specified, you can click on the Start icon (big fluo green array in VirtualBox).
A dialog box may appear “Please select a virtual optic disk …”. Click on the small folder icon and locate the disk image of Ubuntu that was downloaded in a previous step. Then click the Start button.
Ubuntu is now starting from the installation disk. The next section explains how to configure it.
The desktop version of Ubuntu presents the advantage of letting users work directly in the graphical environment of the Ubuntu virtual machine, which is convenient to open non-text result files for visualization (web pages, images) and to analyze the results in other graphical packages (R, openOffice, CytoScape, …).
NOTE CLAVIER FRANÇAIS: for the French Macintosh keyboard, I spent a lot of time to find the solution to use the 3-component keys (e.g. alt-shit-L for the pipe character |). The simplest solution: use the alt key on the RIGHT side of the space bar.
Dialog box Preparing to install Ubuntu.
Installation type:
In the dialog box Write the changes to disk? click Continue.
Where are you?
If you VM has a suitable Internet connexion, your location should be detected automatically. If not, choose the right location.
Field | Value |
---|---|
Your name | RSAT admin |
Your computer’s name | rsat-vb-YYYY-MM |
Pick a username | rsat |
Password | tochng2 |
Log in automatically | I activate it because this will greatly facilitate the use of the Destkop version |
Click Continue |
Ubuntu now installs the system, this should take a few minutes3.
After installation, Ubuntu displays a message “Installation is complete. You need to restart …”. Click Restart now.
When rebooting, Ubuntu warns you that you need to remove the installation medium and close the tray. In our case, the installation media is the iso disk. To remove it, go in the menu Devices -> Optical Drives -> Remove Disk from Optical Drive. If this does not work, close the window with the virtual machine, and restart this virtual machine from VirtualBox.
After reboot, you will automatically log in as RSAT admin user.
For the sake of convenience, I disactivate the lock screen and password prompt options. Indeed, since the VM is running under my account on the hosting system, there is no need to double the security options. For this, click on the Settings icon (toothed wheels) on the top-right corner of the Ubuntu display. Select All Settings and click on the panell Brightness and Lock. Set Lock to off and uncheck Require my password when waking from suspend.
Note: If you are using Ubuntu version 16.04 or later you can skip this section which was useful to fix a problem with version 14.04.
With Ubuntu 14.05, at your first log in, the screen resolution is restricted to 640x480 pixels.
I found a solution to increase the screen resolution here: http://www.juanrubio.me/2014/02/ubuntu-trusty-virtualbox-guest-additions/
sudo apt-get install virtualbox-guest-utils
sudo apt-get install virtualbox-guest-dkms
You need to restart the Virtual machine for the changes to apply.
After rebooting, the VM has a resizable screen: if you increase the VM window, the Ubunutu desktop will adapt its size accordingly.
Due to some bug with VM on Ubuntu 22.04, the terminal fails to start just after installation. This can be fixed by changing the locale to another value than its default (English - United states), and then restarting the VM.
For example, setting it to English United Kingdom will fix the bug.
For the desktop version of Ubuntu, it is convenient to enable copy-paste between the guest and the host.
So far the virtual machine does not support remote access. To add
support for ssh
access, we need to install the appropriate
package.
## Install network and ssh tools
sudo apt-get install --quiet --assume-yes net-tools
sudo apt-get install --quiet --assume-yes ssh
sudo apt-get install --quiet --assume-yes openssh-server
## Test if the ssh is active
sudo systemctl status ssh
## If NOT active, you can activate it as follows
sudo systemctl enable ssh --now
sudo systemctl status ssh # check that is is active
ssh rsat@192.168.56.101
Notes:
The IP address above may be different on your computer, depending
on the network settings of your VirtualBox and on the number of Virtual
Machines currently running. If the address 192.168.56.101
does not work, you can obtain the IP address by typing
ip -c a
in a terminal on your virtual machine.
I personnally find it convenient to establish an ssh connection to the VM, in order to perform the subsequent installation steps from a terminal on my own operating system, but the next installation steps can as well be performed from the terminal in the Virtual Machine’s graphical environment.
It is useful to install some VirtualBox accompanying software on your Ubuntu virtual machine.
sudo apt-get install --assume-yes --quiet virtualbox
sudo apt-get install --assume-yes --quiet virtualbox-dkms
VBoxManage list runningvms
VBoxManage list runningvms | awk -F"[{}]" '{print $2}'
For convenience, we store the IP of the machine of interest in an environment variable VMID.
VMID=`VBoxManage list runningvms | awk -F"[{}]" '{print $2}'`
Get properties of the VM
VBoxManage guestproperty enumerate ${VMID}
List information about a given virtual machine
VBoxManage showvminfo ${VMID}
Note: that command returns the MAC address, but no IP address.
VBoxManage showvminfo ${VMID} | grep '^NIC'
We create two separate users:
Both users (vmuser and rsat) have an initial password provided with the distribution (tochng), but which must be changed at the first login.
################################################################
## Create a user for the virtual machine
##
## This VM user is separate from the rsat user, which only serves to
## manage the RSAT software suite and related packages.
##
## For the sake of security, we force this user to change password at
## first login
## First delete this user (in case it was previously defined)
## sudo userdel --remove vmuser
sudo useradd --password `openssl passwd -1 -salt xyz tochng`\
--home /home/vmuser \
--create-home \
--shell /bin/bash \
--comment "VM user" \
vmuser
## Force vmuser to change password at first login
sudo chage -d 0 vmuser
## Force rsat user to change password at first login
sudo usermod --password `openssl passwd -1 -salt xyz tochng` rsat
sudo chage -d 0 rsat
## Add sudoer rights to vmuser and rsat users
sudo more /etc/sudoers
sudo chmod 644 /etc/sudoers
sudo nano /etc/sudoers
## Find the following line
## # User privilege specification
## root ALL=(ALL:ALL) ALL
## Below it, add the following line:
## rsat ALL=(ALL:ALL) ALL
## vmuser ALL=(ALL:ALL) ALL
## Type "Ctrl-X" to exit from the nano editor, then "Y" to save your changes.
The instructions to install Ubuntu packages are found in the file
INSTALL.md
at the root of the RSAT folder.
Ethernet: optimize solution for a simple setting in the classroom.
Problem of disk occupancy: Ubuntu shared memory occupies 2Gb. This can be modified as explained here.
http://www.cyberciti.biz/tips/what-is-devshm-and-its-practical-usage.html
For the desktop version, I should try to use the Advanced installation in order to use less disk without loosing too much confort. For example, I could inactivate the support for all the languages that are installed by default (downloading language packs).
## Set up time zone, date and time (source:
## https://help.ubuntu.com/community/UbuntuTime).
sudo apt-get install console-data
sudo dpkg-reconfigure console-data
## (for my laptop, mac / Unknown / French /Standard / New)
TO BE WRITTEN
Once the Virtual Machine is working fine, it can be exported to an appliance.
Shut down the Virtual Machine if it has not been done yet.
In VirtualBox, open “File -> Export Appliance …”, and select the VM.
Parameter | Value |
---|---|
Name | rsat-vb-YYYY-MM |
Product | Regulatory Sequences Analysis Tools |
Product-URL | http://rsat.eu/ |
Vendor | Jacques van Helden |
Vendor URL | http://jacques.van-helden.perso.luminy.univ-amu.fr/ |
Version | YYYY-MM |
Description | Regulatory Sequence Analysis Tools (RSAT, http://rsat.eu/), version YYYY-MM, installed on an Ubuntu 16.04 Virtual Machine. |
License | Free of use for academic users, non-commercial and non-military usage. |
Prepare the VM + accompanying material on a USB key, to ensure distribution in the teaching room. We use ScanDisk 64Gb USB3.0 keys, which have a high transfer rate (190Mbps write / 250Mbps read).
SOURCE_DIR=/no_backup/VirtualBox_VMs/appliances
VERSION=YYYY-MM
## Specification of the target location
KEY_NB=02
TARGET_DIR=/Volumes/RSAT-VM_${KEY_NB}/
time rsync -ruptvl ${SOURCE_DIR} ${TARGET_DIR}
This can be useful for two purposes.
SPLIT_SIZE=3999m
mkdir -p ${TARGET_DIR}/appliances
time split -b ${SPLIT_SIZE} ${SOURCE_DIR}/rsat-vb-YYYY-MM_${VERSION}.ova ${TARGET_DIR}/appliances/rsat-vb-YYYY-MM_${VERSION}.ova.split${SPLIT_SIZE}_
I downloaded the install disk from here:
http://centos.mirrors.ovh.net/ftp.centos.org/6.8/isos/x86_64/CentOS-6.8-x86_64-LiveCD.iso
Installation steps:
I have a French - French Macintosh, so I use it for installation, but I will later add an English keybord for the distribution.↩︎
This password is obviously not safe, but it will be changed at the end of the installation↩︎
Note if you did activate the option to update Ubuntu packages in the previous window, the installation can take several minutes↩︎