This is an old revision of the document!
Debian Template VM
To speed-up later VMs deployments, you better start creating a VM template that will fit most of your later needs as a base OS. One of the most stable, versatile and full-featured distribution which is extremely well supported by an extended community throughout the world is Debian.
This is the reason we'll use this distro as our base OS to setup our fresh VM template.
This template will be based on the latest Debian Stable release which, at the time of writing, is Debian Stretch (9.4.0).
PLEASE NOTE: although all of the installation process steps will be identical whatever your virtualization environment, what follows includes steps specifically intended to prepare a VM that will run within a VirtualBox environment, we'll also try to present the steps required to build this VM in a XenServer environment.
In case you'd like to know how to install VirtualBox on a Debian (LMDE 2) workstation, you can refer to this other wiki article.
Configure a Fresh VM
Under VirtualBox
Memory and Storage
Open the VirtualBox desktop application and use the “New” button to start creating a fresh virtual machine, we'll use the following:
- Name: Debian-9.4.0
- Type: Linux
- Version: Debains (64-bit)
Let's allow 512M of RAM and an 8GB hard disk, you can change these values to fit your needs.
- Memory: 512 MB
- Hard disk: Create a virtual hard disk now
- VDI
- Dynamically allocated
- 8.00GB
Create the VM.
Networking
In our general purpose template, we'd like to have, by default, two inner networks:
- NAT network allowing access to the Internet (via DHCP)
- Host-only network allowing management access on a fixed IP
In this way, the guest OS will never interfere with the network in which the host machine evolves, as it will use NAT and DHCP to the host for Internet access. We'll also have a persistent, fixed, IP address which we can use to access this specific VM through the Host-only network.
VirtualBox offers a simple and elegant way to achieve this configuration.
In the VirtualBox desktop application, go to the menu File > Preferences (Ctrl-G) and select Network in the left list.
In the NAT Networks, double click on the existing NatNetwork entry (or click on the + icon on the right to create a new entry). Configure it as follow:
- Network Name: NatNetwork
- Network CIDR: 10.0.2.0/24
- Network Options
- Support DHCP
The 10.0.2.0/24 might need to be changed in case your local network is already using those sub-network addresses…
Then click the Host-only Networks tab and click on the + icon on the right to create a new network if it doesn't already exist:
- Adapter vboxnet0
- IPv4 Address: 172.20.20.1
- IPv4 Network Mask: 255.255.255.0
Leave DHCP server empty for this config, feel free to use any private IP addresses range:
- 10.0.0.0 to 10.255.255.255
- 172.16.0.0 to 172.31.255.255
- 192.168.0.0 to 192.168.255.255
Debian ISO
Now we need the debian .iso file to initiate the VM OS install. All installation images for Debian are available on the Get Debian page, we'll use the 64-bit PC netinst iso image, downloading it somewhere on our host system, lets say our downloaded file location is: /home/<myuser>/Downloads/debian-9.4.0-amd64-netinst.iso
Let's now associate this iso file as the startup disk for our VirtualBox VM:
In the VirtualBox desktop application interface, having your fresh VM selected in the left column, click on the Storage tab. You should see a panel exposing 2 controllers:
- Controller: IDE
- Empty
- Controller: SATA
- Debian-9.4.0.vdi
Select the empty entry by clicking on the CD disk icon, then, on the right, under attributes “Optical Drive:“, select IDE Primary Master, then click the CD icon next to the po-up menu and, in the dialog that opens, select the downloaded Debian .iso file you got from the previous step: /home/<myuser>/Downloads/debian-9.4.0-amd64-netinst.iso
Start the VirtualBox VM using the Start button on top of the VitualBox window.
Debian Installer
Let's start our VM to delve into the Debian installation process (click on the green arrow in the VirtualBox interface). A window opens, showing you the Debian installation interface. As a general rule you can use the up, down, left, right and tab and Enter keys to navigate the menus the Debian installer will present you.
Select the first option: Graphical Install (enter)
Use up / down arrows keyboard keys or your mouse to select what's appropriate to your needs:
- Language
- Location
- Locales (United States - en_US.UTF-8 is recommended)
- Keyboard
Select the first Ethernet controller (enp0s3) that is associated with the NAT network.
Select a hostname for the system: deb9 (continue)
Leave domain name empty
Set root password.
New user: System Admin
Username for user account: sysad
Password:
Partitioning method:
- Manual
- SCSI (0,0,0) (sda) 8.6 GB ATA VBOX HARDISK
- yes
- Select FREE SPACE (continue)
- Create a new partition
- Leave default size (all disk)
- Primary
- Set bootable flag to on (double click or select and space)
- Done setting up the partition
- Finish partitioning and write changes to disk
You'll be asked if you want to proceed without a swap partition, go ahead and say “no”, as we'll create a swap file later-on.
This choice is aiming at simplifying potential subsequent needs of extending the hard disk partition, since we won't have to worry about partitioning scheme and will only have one single partition to extend.
Write the changes to disk? … yes
Scan another DVD? … No
Configure the package manager:
get back to the top of the list: enter information manually:
- deb.debian.org as mirror hostname
- directory: /debian/
- proxy: (leave blank)
The http://deb.debian.org address is intended to always link your system to the most effective mirror related to the place where you're currently standing. Please refer to the deb.debian.org site for more information.
Popularity contest … pick your choice
Software selection:
- uncheck: Debian desktop environment
- check only: ssh server + standard system utilities
Accept the default GRUB loader master boot record location (/dev/sda).
The Debian installation process has completed !
Network Configuration
NIC's
The first thing we'll do is setup the NICs configuration so that we'll have access to the system through an ssh connection. As we've linked 2 NICs to our VM, we'll use the one on the NAT network with DHCP, while configuring a static IP on the other, linked to the vboxnet0 virtual network.
To do so, we use the console that VirtualBox presents for the running VM and log in as root.
First we check the IP configuration:
> ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 08:00:27:bc:55:8e brd ff:ff:ff:ff:ff:ff inet 10.0.2.15/24 brd 10.0.2.255 scope global enp0s3 valid_lft forever preferred_lft forever inet6 fe80::a00:27ff:febc:558e/64 scope link valid_lft forever preferred_lft forever 3: enp0s8: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 08:00:27:44:2f:bd brd ff:ff:ff:ff:ff:ff
We see that the NAT NIC is named enp0s3
and has received an IP address, while the vboxnet0 NIC is referred to as enp0s8
, but this one is DOWN.
Let's change this by editing the /etc/network/interfaces
configuration file. In order to assign a static IP on vboxnet0 for our VM and keep the DHCP on the NAT, something like the following should do:
> nano /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The NAT network interface allow-hotplug enp0s3 iface enp0s3 inet dhcp # The vboxnet0 network interface allow-hotplug enp0s8 iface enp0s8 inet static address 172.20.20.10/24
Use CTRL+x, Y, Enter to save the file
Restarting the network is sometimes tricky, so as long as we're still configurating our VM, the easiest way is to reboot, but don't be too fast !
Login using an rsa key
For ease of use we'll want to be able to login as root using an rsa key, which will be uploaded using the ssh-copy-id
command, but this requires us to be able to log in at least once using a password
Let's prepare that by editing our ssh daemon configuration file /etc/ssh/sshd_config
:
> nano /etc/ssh/sshd_config REPLACE (line 32) #PermitRootLogin prohibit-password WITH PermitRootLogin yes
CTRL+x, y, Enter, to save the file.
We're now ready to reboot:
> reboot
Once the VM has rebooted, we should be able to access it using a terminal on the host machine.
To make sure this works, let's ping our guest VM:
On HOST console
> ping 172.20.20.10 PING 172.20.20.10 (172.20.20.10) 56(84) bytes of data. 64 bytes from 172.20.20.10: icmp_seq=1 ttl=64 time=0.511 ms 64 bytes from 172.20.20.10: icmp_seq=2 ttl=64 time=0.560 ms 64 bytes from 172.20.20.10: icmp_seq=3 ttl=64 time=0.547 ms ...
Since the VM can be reached, let's upload our rsa key to it.
In case you don't have an rsa key pair on your computer, and don't know how to generate it, you can refer to this DigitalOcean Tutorial to learn how to do this.
on HOST console
> ssh-copy-id -i ~/.ssh/id_rsa.pub root@172.20.20.10 /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys root@172.20.20.10's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'root@172.20.20.10'" and check to make sure that only the key(s) you wanted were added.
Now that our key is on the guest VM, we'll log into it without having to enter a password. We'll immediately reinforce no password login for root once we're hooked:
on GUEST console
> nano /etc/ssh/sshd_config REPLACE (line 32) PermitRootLogin yes WITH PermitRootLogin prohibit-password
CTRL+x, y, Enter, to save the file
Note that this time the line is uncommented, this means we need an rsa key to login as root.
All that is left is to reload our ssh daemon configuration to enforce the new configuration:
> systemctl reload sshd
Shell Customization & Utilities
The default shell is sometimes a bit difficult to read, an there are a few useful utilities that we'd want to have at hand to manage our VM, so let's install our favorite ones. Note that the apt-get update
and
apt-get upgrade
instructions are not necessary on a fresh install, they are here only to remind one that it's always best to update the system before a complementary package installation:
Additional Packages
> apt-get update > apt-get upgrade > apt-get install htop nload sysstat tmux ranger lnav
We won't detail here and now what each package does or how to use it, but feel free to discover what each of those can help you do in the shell, you won't be disappointed…
htop
Could be considered as top
on steroïds: The Power-User’s Guide to htop
nload
Will give you a graphic vision of the machine's NICs usage: read more here.
sysstat
This article explains how to install and configure sysstat
package (which contains sar utility), This article can also give you some ideas on how to use sysstat
to monitor the following Linux performance statistics using sar.
- Collective CPU usage
- Individual CPU statistics
- Memory used and available
- Swap space used and available
- Overall I/O activities of the system
- Individual device I/O activities
- Context switch statistics
- Run queue and load average data
- Network statistics
- Report sar data from a specific time
tmux
At the very basic tmux
would be called a terminal multiplexer. Simply speaking, tmux acts as a window manager within your terminal and allows you to create multiple windows and panes within a single terminal window.
You are invited to consult this Quick and Easy Guide to tmux as a starting point. Also this cheat sheet can be helpful once you start harnessing tmux
powers.
ranger
ranger
is a file manager that works in a terminal window and provides a smooth way to view and edit files.
Here is a nice reference for ranger functions: http://ranger.nongnu.org/ranger.1.html
lnav
As it calls itself, lnav
is The Log File Navigator. It's incredibly helpful when it comes to visualize and analyze all types of log files. You can start by reading the ''lnav'' documentation to get an idea of what it is capable of.
Bash Shell Configuration
Colors
One of the main difficulty in reading the console is that, unconfigured, it is totally monochromatic.
Adding colors can help the user's eye catch the structure and meanings of the output. That's what we'll do now.
Shell Prompt
Spotting the shell prompt is important as it not only can bring some important info, like the user/server names and working directory, it also allows to visually separate each command output. Here is a way to greatly enhance your shell prompt, not only colorizing it, but choosing what info is displayed.
The following example was created using the great tool available at http://bashrcgenerator.com/, it's warmly recommended that you build your own prompt using this fantastic tool.
in ~/.bashrc
# Colored prompt tty -s && export PS1="\[\033[38;5;130m\][\d]\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;208m\]\t\[$(tput sgr0)\]\[\033[38;5;15m\]\n\[$(tput sgr0)\]\[\033[38;5;75m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\]\n\[$(tput sgr0)\]\[\033[38;5;82m\]\u\[$(tput sgr0)\]\[\033[38;5;64m\]@\[$(tput sgr0)\]\[\033[38;5;71m\]\H\[$(tput sgr0)\]\[\033[38;5;15m\] > \[$(tput sgr0)\]"
Note that, in our .bashrc
code, we add tty -s &&
in front of this to avoid errors when connecting through ssh from a non-tty instance (like rsync or zfs send/receive).
Colored prompt in tmux
As we plan to use tmux (a lot), we'll need to have it run in 256 colors, which is not the case by default. To fix this we need to alias the tmux command as well as modify the tmux configuration file:
in ~/.bashrc
# tmux 256 colors for prompt compatibility alias tmux='TERM=xterm-256color tmux'
in ~/.tmux.conf
set -g default-terminal "screen-256color"
Listing colors
Another enhancement that a colored shell can bring is an easy way to identify listed elements by their color. The simplest way to achieve this is by adding the following code in you ~/.bashrc
file:
in ~/.bashrc
# Listing colors export LS_OPTIONS='--color=auto' eval "$(dircolors -b)" alias ls='ls $LS_OPTIONS'
This will colorize your listing outputs with the preconfigured dircolors
values. You could spend some time building your own preferred file types colors by using the references presented on this linux-sxs.org page. That would be used in your ~/.bashrc
file as follow:
in ~/.bashrc
alias ls='ls --color' LS_COLORS='di=92:fi=0:ln=100:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=95:*.rpm=90' export LS_COLORS
Aliases
Finally, aliases are a great way to simplify some commands usage. Here is one example that makes nano
always display the line/character number you're editing:
in ~/.bashrc
# CUSTOM ALIASES alias nano="nano -c"
System Configuration
Pre-Login Message
As it might be convenient to have some information when starting up the VM, we'll modify the pre-login message as follow:
> sudo nano /etc/issue Debian GNU/Linux 9 [\v] Host: \n TTY: \l Time: \d \t IP[enp0s3]: \4{enp0s3} IP[enp0s8]: \4{enp0s8}
On next boot, the VM's initial login screen will display some info, notably IP addresses of eth0
& eth1
interfaces.
sudo
In case you want to allow users to up their privileges, you could install sudo to let them act as superusers:
> su root password: > apt-get install sudo > usermod -a sysadmin -G sudo
You might need to uncomment the sudo group members line in /etc/sudoers
using visudo:
[> su root] [password:] > visudo Check for line: # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL
Make sure this line is NOT commented out.
Please note that you might have to re-connect to a new session to have the user's sudo rights activated.
Time Sync
One important aspect when setting up a new system is time synchronization, to achieve this we'll use ntp
. Debian 9 has time synchronization built in and activated by default using the standard ntpd
time server, provided by the ntp
package.
First lets check whether the ntp
time server is running:
> service ntp status OR > systemctl status ntp
If you get an answer of type : Unit ntp.service could not be found.
, you need to install, and maybe configure, the ntp
and ntpdate
packages, then check the ntp service has been started:
> apt-get install ntp ntpdate > systemctl status ntp ● ntp.service - LSB: Start NTP daemon Loaded: loaded (/etc/init.d/ntp; generated; vendor preset: enabled) Active: active (running) since Thu 2018-11-22 16:38:06 UTC; 16s ago Docs: man:systemd-sysv-generator(8) CGroup: /system.slice/ntp.service └─27000 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 108:112 Nov 22 16:38:10 cloud ntpd[27000]: Soliciting pool server 37.187.104.44
Last, we want to setup the ntp
service to automatically start at startup:
> systemctl enable ntp
You can refer to this page to learn more about the service's configuration.
You can refer to this list of systemctl commands to see how to manage services.
SMART
The following only applies to physical servers
smartmontools
is a set of applications that can test hard drives, automatically notify you when the failure rate rises and read the harddisk SMART statistics to detect failures early. For a complete How To check this article @howtoforge.com.
The smartmontools package contains two utility programs (smartctl and smartd) to control and monitor storage systems using the Self-Monitoring, Analysis and Reporting Technology System (SMART).
> apt-get install smartmontools > lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 1.8T 0 disk ├─sda1 8:1 0 511M 0 part sdb 8:16 0 1.8T 0 disk ├─sdb1 8:17 0 511M 0 part sdc 8:32 1 1.8T 0 disk ├─sdc1 8:33 1 511M 0 part > smartctl -i /dev/sda smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.9.138-xxxx-std-ipv6-64] (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Device Model: HGST HUS726020ALA610 Serial Number: N4G3M6DY ... SMART support is: Available - device has SMART capability. SMART support is: Enabled
Check the last 2 lines to make sure SMART is enabled on each device you want to monitor, if you need to enable it (it won't do any harm if already enabled):
> smartctl -s on /dev/sda
To check the complete SMART information for an IDE drive and SATA drive type:
# (for IDE drives) > sudo smartctl -a /dev/sda # (for SATA drives) > sudo smartctl -a -d ata /dev/sda
You can check your hard drive's status by typing:
> sudo smartctl -H /dev/sda
The tool used to test your hard drive has three types of tests to perform, Short, Extended & Conveyance.
You can check which is available by typing:
> sudo smartctl -c /dev/sda ... Self-test supported. No Conveyance Self-test supported. ... Short self-test routine recommended polling time: ( 2) minutes. Extended self-test routine recommended polling time: ( 288) minutes. ...
To effectively launch a test:
> sudo smartctl -t short /dev/sda > sudo smartctl -t long /dev/sda > sudo smartctl -t conveyance /dev/sda === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION === Sending command: "Execute SMART Short self-test routine immediately in off-line mode". Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful. Testing has begun. Please wait 2 minutes for test to complete. Test will complete after Sat Nov 24 00:12:47 2018 Use smartctl -X to abort test.
To get the test results you will have to type:
> sudo smartctl -l selftest /dev/sda
Automating Actions
We can run smartmontools
as a system Deamon in order to have the tests run automatically, to do this we'll edit the smartmontools
config file:
> sudo nano /etc/default/smartmontools ... # uncomment to start smartd on system startup start_smartd=yes ...
Now, smartd
will be launched at boot time.
To define how SMART will scan the disk and what actions are to be taken if SMART returns any error:
> sudo nano /etc/smartd.conf ... # CHECK THAT THE FOLLOWING IS UNCOMMENTED DEVICESCAN -a -H -l error -l selftest -f -s(S/../..././02|L/../../1/00)-m tech@tacticz.com -M exec /usr/share/smartmontools/smartd-runner...
( -a) This enables some common options. You almost certainly want to use it. To check the SMART health status (-H). To report increases in both SMART error logs (-l). To check for failure of any Usage Attributes (-f) . ”-s (S/../.././02|L/../../1/00)” This schedules the short and long self-tests. In this example, the short self-test will run daily at 2:00 A.M. The long test will run on every Monday at 0:00. For more information, see the smartd.conf man page.
To test that everything works as expected, an specifically that an email gets sent to the destination address, add -M test
right after the DEVICESCAN
keyword and restart smartd:
> nano /etc/smartd.conf ... DEVICESCAN -M test -a -H -l error -l selftest -f -s (S/../..././02|L/../../1/00) -m tech@tacticz.com -M exec /usr/share/smartmontools/smartd-runner ... > systemctl restart smartd
Watching the var/log/deamon.log
file will let you know if a problem occurs:
> lnav /var/log/ ... Nov 24 01:00:16 stock smartd[21081]: Your system does not have /usr/bin/mail. Install the mailx or mailutils package Nov 24 01:00:16 stock smartd[21081]: run-parts: /etc/smartmontools/run.d/10mail exited with return code 1 Nov 24 01:00:16 stock smartd[21081]: Test of /usr/share/smartmontools/smartd-runner to tech@tacticz.com: failed (32-bit/8-bit exit status: 256/1) ...
We need to install a package to allow emails to be sent…
Sending Mail
To avoid having to configure a local postfix
server, we'll install the heirloom-mailx
package and configure it to use an external smtp relay, see the whole article @systurials.com.
> apt-get install heirloom-mailx > cd /usr/bin/ > ln -s heirloom-mailx mailx
We need to create the mailx
symbolic link in order to have it available as such under the command line.
Let's test our external smtp server using an all-in-one command:
> echo "My message body" | mailx -v \ -s "Server Test Mail" \ -S smtp-use-starttls \ -S ssl-verify=ignore \ -S smtp-auth=login \ -S smtp=smtp://smtp.gmail.com:587 \ -S from="*******@gmail.com(System Watch)" \ -S smtp-auth-user=*******@gmail.com \ -S smtp-auth-password=******* \ name@domain.com Resolving host "smtp.gmail.com:587" ... done Connecting to "2a00:1450:400c:c06::6c:587" ...connected.
When this works, and you effectively receive the email at the name@domain.com
address, it's time to configure the default smtp relay for mailx
and send a last test:
> nano ~/.mailrc TYPE set smtp-use-starttls set ssl-verify=ignore set smtp=smtp://smtp.gmail.com:587 set smtp-auth=login set smtp-auth-user=thibaut.demuynck@gmail.com set smtp-auth-password=H3rcul35 set from="thibaut.demuynck@gmail.com(System Watch)" > echo "Configured mailx defaults" | mailx -v -s "Mailx Defaults" tech@tacticz.com Resolving host "smtp.gmail.com:587" ... done Connecting to "2a00:1450:400c:c0b::6d:587" ...connected.
FAIL2BAN
On a physical server it might be a good idea to install fail2ban
to establish a minimal protection.
https://upcloud.com/community/tutorials/install-fail2ban-debian/
Install VirtualBox guest additions
On Debian 8
> apt-get install build-essential module-assistant > m-a prepare
On Debian 9
Note that VirtualBox 5.2.12 was required to successfully complete those operations on a Debian 9.4.0 install. To get a complete explanation on how to install the latest VirtualBox on your host system please refer to this virtualbox.org page.
> sudo apt install -y linux-headers-amd64 > sudo apt build-dep -y linux
From VM's window menu: Devices > Insert Guest Additions CD image…
> mount /dev/cdrom /media/cdrom mount: /dev/sr0 is write-protected, mounting read-only > sh /media/cdrom/VBoxLinuxAdditions.run
You'll need to reboot to have the guest additions loaded
> reboot
In case your new install requires the installation of the VirtualBox Extension Pack (to support USB2/3, NVMe etc…), download the latest Extension Pack as follow:
> cd ~/Downloads > LatestVirtualBoxVersion=$(wget -qO - http://download.virtualbox.org/virtualbox/LATEST.TXT) && wget "http://download.virtualbox.org/virtualbox/${LatestVirtualBoxVersion}/Oracle_VM_VirtualBox_Extension_Pack-${LatestVirtualBoxVersion}.vbox-extpack"
Then, in the VirtualBox UI, go to File > Preferences… > Extensions
and use the green +
icon to locate the previously downloaded vbox-extpack file.
Install XenServer Tools
In case you are working with XenServer, you first need to connect the xs-tools.iso
to your newly installed VM. This can be achieved using a GUI application like XenCenter (Windows only) or OpenXenManager (Python > All platforms). You might also choose to install Xen Orchestra as a VM straight on your XenServer platform, which will give you access to a nice Web GUI to manage your XenServer pools.
If you prefer to use the command line interface, refer to this (russian) article for the details. The command to link an ISO to a VM is something like: xe vm-cd-insert cd-name=“name-label of device” vm=“name-label of VM”
.
Once the xs-tools.iso
is connected to your debian VM, do the following on the VM CLI to install XenTools:
> mount /dev/cdrom /mnt > bash /mnt/Linux/install.sh > umount /dev/cdrom
In case you get a message like:
mount: wrong fs type, bad option, bad superblock on /dev/sr0, missing codepage or helper program, or other error
Try to issue the mount /dev/cdrom /mnt
command a second time, this seems to work !
Other OSs
To figure out how to install the XenServer Tools on other OSs, please refer to this XenOrchestra web page.