Difference between revisions of "Vnx-rootfsubuntu"
(→Installing additional software) |
|||
Line 3: | Line 3: | ||
== Basic installation == | == Basic installation == | ||
− | Follow this procedure to create a Ubuntu based root-file-system for VNX. The procedure has been tested with Ubuntu 9.10, 10.04, 10.10 and | + | Follow this procedure to create a Ubuntu based root-file-system for VNX. The procedure has been tested with Ubuntu 9.10, 10.04, 10.10, 11.04 and 12.04. |
<ul> | <ul> | ||
<li>Create the filesystem disk image:</li> | <li>Create the filesystem disk image:</li> | ||
− | qemu-img create -f qcow2 vnx_rootfs_kvm_ubuntu | + | qemu-img create -f qcow2 vnx_rootfs_kvm_ubuntu.qcow2 8GB |
<li>Get Ubuntu installation CD. For example:</li> | <li>Get Ubuntu installation CD. For example:</li> | ||
− | wget ftp://ftp.rediris.es/mirror/ubuntu-releases/ | + | wget ftp://ftp.rediris.es/mirror/ubuntu-releases/12.04/ubuntu-12.04-server-i386.iso |
− | cp ubuntu- | + | cp ubuntu-12.04-server-i386.iso /almacen/iso |
− | <li>Create | + | Note: use 'server' or 'desktop' CD versions depending on the system you want to create. |
− | + | <li>Create the virtual machine with:</li> | |
− | + | vnx --create-rootfs vnx_rootfs_kvm_ubuntu.qcow2 --install-media /almacen/iso/ubuntu-12.04-server-i386.iso --mem 512M | |
− | + | <li>Follow Ubuntu installation menus to install a basic system with ssh server.</li> | |
− | + | <li>Configure a serial console on ttyS0:</li> | |
− | + | cd /etc/init | |
− | + | cp tty1.conf ttyS0.conf | |
− | + | sed -i -e 's/tty1/ttyS0/' ttyS0.conf | |
− | + | <li>Activate startup traces on serial console by editting /etc/default/grub file and setting the GRUB_CMDLINE_LINUX_DEFAULT variable to "console=ttyS0". Also change the boot menu timeout to 0 (sometimes virtual machines get stopped on the boot menu when starting on high loaded systems):</li> | |
− | + | GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0" | |
− | + | GRUB_TIMEOUT=0 | |
− | + | <li>Make grub process the previous changes:</li> | |
− | + | update-grub | |
− | + | <li>Finally, delete the net udev rules file and halt the system:</li> | |
− | + | rm /etc/udev/rules.d/70-persistent-net.rules | |
− | + | halt -p | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | <li> | ||
− | |||
− | |||
− | |||
− | <li> | ||
− | |||
− | |||
− | |||
</ul> | </ul> | ||
Line 62: | Line 31: | ||
<ul> | <ul> | ||
− | <li> | + | <li>Restart the system with the following command:</li> |
− | < | + | vnx --modify-rootfs vnx_rootfs_kvm_ubuntu.qcow2 --update-aced --mem 512M |
− | <li>Access the console and sudo root: </li> | + | Note: ignore the errors "timeout waiting for response on VM socket". 768M are needed if you are installing a root filesystem with desktop interface |
+ | <li>Access the system through the text console to easy the copy-paste of commands:</li> | ||
+ | virsh console vnx_rootfs_kvm_ubuntu.qcow2 | ||
+ | <li>Access the console and sudo root:</li> | ||
sudo su | sudo su | ||
<li>Update the system</li> | <li>Update the system</li> | ||
Line 71: | Line 43: | ||
<li>Install XML::DOM perl package and ACPI daemon:</li> | <li>Install XML::DOM perl package and ACPI daemon:</li> | ||
apt-get install libxml-dom-perl acpid | apt-get install libxml-dom-perl acpid | ||
− | <li>Only for Ubuntu 10.04:</li> | + | <!--li>Only for Ubuntu 10.04:</li> |
<ul> | <ul> | ||
<li>create /media/cdrom* directories:</li> | <li>create /media/cdrom* directories:</li> | ||
Line 81: | Line 53: | ||
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0 | /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0 | ||
/dev/scd1 /media/cdrom1 udf,iso9660 user,noauto,exec,utf8 0 0 | /dev/scd1 /media/cdrom1 udf,iso9660 user,noauto,exec,utf8 0 0 | ||
− | </ul | + | </ul--> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<li>Install VNX autoconfiguration daemon:</li> | <li>Install VNX autoconfiguration daemon:</li> | ||
− | + | mount /dev/sdb /mnt/ | |
− | + | perl /mnt/vnxaced-lf/install_vnxaced | |
− | / | + | <li>Edit /etc/network/interfaces file and comment all lines related to eth0, eth1, etc interfaces. Leave only the loopback (lo) interface.</li> |
− | <li> | ||
− | |||
− | |||
− | </ | ||
<li>Optional: install graphical user interface.</li> | <li>Optional: install graphical user interface.</li> | ||
<ul> | <ul> | ||
Line 105: | Line 64: | ||
<li>Complete:</li> | <li>Complete:</li> | ||
sudo apt-get install ubuntu-desktop | sudo apt-get install ubuntu-desktop | ||
+ | Note: to avoid nautilus being launched any time you remotely execute a command on the virtual machine using VNX (which interferes with the normal execution of commands), you should disable the start of programs when media insertion takes place. Go to "System settings->System->Details->Removable Media" and deselect the checkbox "Never prompt or start programs on media insertion". | ||
+ | <!-- | ||
+ | nautilus automount feature. Just execute gconf-editor and create a variable "/apps/nautilus/preferences/media_automount" and set it to 0. | ||
+ | This does not seem to work: | ||
+ | gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type bool --set "/apps/nautilus/preferences/media_automount" "false" | ||
+ | gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type bool --set "/apps/nautilus/preferences/media_automount_open" "false" | ||
+ | --> | ||
</ul> | </ul> | ||
<li>Optional: install other services:</li> | <li>Optional: install other services:</li> | ||
Line 114: | Line 80: | ||
sudo apt-get install traceroute | sudo apt-get install traceroute | ||
</ul> | </ul> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<li>Create a file /etc/vnx_rootfs_version to store version number and informacion about modification:</li> | <li>Create a file /etc/vnx_rootfs_version to store version number and informacion about modification:</li> | ||
<pre> | <pre> | ||
− | VER=v0. | + | VER=v0.24 |
− | OS=Ubuntu | + | OS=Ubuntu 12.04 |
− | DESC=basic Ubuntu | + | DESC=basic Ubuntu 12.04 root-file-system without GUI |
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<li>Stop the machine with that script:</li> | <li>Stop the machine with that script:</li> | ||
vnx_halt | vnx_halt | ||
− | |||
</ul> | </ul> | ||
− | If everything went well, your root filesystem will be ready to be used with VNX. You can make a simple test using the simple_ubuntu.xml scenario distributed with VNX. | + | If everything went well, your root filesystem will be ready to be used with VNX. You can make a simple test using the simple_ubuntu.xml scenario distributed with VNX. |
− | + | == Installing additional software == | |
− | To install additional software or modify your root file system, you just have to | + | To install additional software or to modify your root file system, you just have to: |
<ul> | <ul> | ||
− | <li>Start a | + | <li>Start a virtual machine from it:</li> |
− | + | vnx --modify-rootfs vnx_rootfs_kvm_ubuntu.qcow2 | |
− | + | <li>Check network connectivity. Maybe you have to activate the network interface by hand:</li> | |
− | <li> | + | dhclient eth1 |
− | + | Note: use "ip link show" to know which network interface to use. | |
− | <li> | + | <li>Do the modifications you want.</li> |
− | + | <li>Finally, halt the system using:</li> | |
− | <li> | ||
vnx_halt | vnx_halt | ||
</ul> | </ul> | ||
Line 207: | Line 123: | ||
</ul> | </ul> | ||
− | + | == Updating VNXACED == | |
− | |||
− | |||
− | + | You can automatically update the VNXACE daemon with the following command: | |
− | + | vnx --modify-rootfs vnx_rootfs_kvm_ubuntu.qcow2 --update-aced -y | |
− | + | If VNXACE daemon is not updated automatically, you can do it manually by accessing the virtual machine console and type: | |
− | + | mount /dev/sdb /mnt/ | |
− | + | perl /mnt/vnxaced-lf/install_vnxaced | |
− | |||
− | / | ||
− | |||
− | |||
− | + | == Known problems == | |
<ul> | <ul> | ||
+ | <li>In Ubuntu 12.04 Desktop, graphical commands execution does not work. Command execution fails with "ERROR: no user logged on display :0.0" (see /var/log/vnxaced.log). If you just open a "terminal" window, commands work correctly (does not work if you open other applications; only when you start a terminal...).</li> | ||
<li>Each time a cdrom is mounted (for example, whenever a command is executed on the virtual machine) the following error appears in the console:</li> | <li>Each time a cdrom is mounted (for example, whenever a command is executed on the virtual machine) the following error appears in the console:</li> | ||
<pre> | <pre> |
Revision as of 13:00, 28 May 2012
How to create a Ubuntu root-file-system for VNX
Contents
Basic installation
Follow this procedure to create a Ubuntu based root-file-system for VNX. The procedure has been tested with Ubuntu 9.10, 10.04, 10.10, 11.04 and 12.04.
- Create the filesystem disk image:
qemu-img create -f qcow2 vnx_rootfs_kvm_ubuntu.qcow2 8GB
wget ftp://ftp.rediris.es/mirror/ubuntu-releases/12.04/ubuntu-12.04-server-i386.iso cp ubuntu-12.04-server-i386.iso /almacen/iso
Note: use 'server' or 'desktop' CD versions depending on the system you want to create.
vnx --create-rootfs vnx_rootfs_kvm_ubuntu.qcow2 --install-media /almacen/iso/ubuntu-12.04-server-i386.iso --mem 512M
cd /etc/init cp tty1.conf ttyS0.conf sed -i -e 's/tty1/ttyS0/' ttyS0.conf
GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0" GRUB_TIMEOUT=0
update-grub
rm /etc/udev/rules.d/70-persistent-net.rules halt -p
Configuration
- Restart the system with the following command:
vnx --modify-rootfs vnx_rootfs_kvm_ubuntu.qcow2 --update-aced --mem 512M
Note: ignore the errors "timeout waiting for response on VM socket". 768M are needed if you are installing a root filesystem with desktop interface
virsh console vnx_rootfs_kvm_ubuntu.qcow2
sudo su
apt-get update apt-get dist-upgrade
apt-get install libxml-dom-perl acpid
mount /dev/sdb /mnt/ perl /mnt/vnxaced-lf/install_vnxaced
- Minimal:
sudo apt-get install xorg gnome-core gksu gdm gnome-system-tools gnome-nettool firefox-gnome-support
sudo apt-get install ubuntu-desktop
Note: to avoid nautilus being launched any time you remotely execute a command on the virtual machine using VNX (which interferes with the normal execution of commands), you should disable the start of programs when media insertion takes place. Go to "System settings->System->Details->Removable Media" and deselect the checkbox "Never prompt or start programs on media insertion".
- Apache server:
sudo apt-get install apache2 update-rc.d -f apache2 remove # to avoid automatic start
sudo apt-get install traceroute
VER=v0.24 OS=Ubuntu 12.04 DESC=basic Ubuntu 12.04 root-file-system without GUI
vnx_halt
If everything went well, your root filesystem will be ready to be used with VNX. You can make a simple test using the simple_ubuntu.xml scenario distributed with VNX.
Installing additional software
To install additional software or to modify your root file system, you just have to:
- Start a virtual machine from it:
vnx --modify-rootfs vnx_rootfs_kvm_ubuntu.qcow2
dhclient eth1
Note: use "ip link show" to know which network interface to use.
vnx_halt
Examples
- dhcp server and relay:
- Install dhcp3 packages:
apt-get install dhcp3-server dhcp3-relay
update-rc.d -f isc-dhcp-server remove update-rc.d -f isc-dhcp-relay remove
Updating VNXACED
You can automatically update the VNXACE daemon with the following command:
vnx --modify-rootfs vnx_rootfs_kvm_ubuntu.qcow2 --update-aced -y
If VNXACE daemon is not updated automatically, you can do it manually by accessing the virtual machine console and type:
mount /dev/sdb /mnt/ perl /mnt/vnxaced-lf/install_vnxaced
Known problems
- In Ubuntu 12.04 Desktop, graphical commands execution does not work. Command execution fails with "ERROR: no user logged on display :0.0" (see /var/log/vnxaced.log). If you just open a "terminal" window, commands work correctly (does not work if you open other applications; only when you start a terminal...).
- Each time a cdrom is mounted (for example, whenever a command is executed on the virtual machine) the following error appears in the console:
Jul 27 22:33:31 vnx kernel: [ 4384.875886] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 Jul 27 22:33:31 vnx kernel: [ 4385.291374] ata1.01: BMDMA stat 0x5 Jul 27 22:33:31 vnx kernel: [ 4385.493411] sr 0:0:1:0: [sr0] CDB: Read(10): 28 00 00 00 00 18 00 00 01 00 Jul 27 22:33:31 vnx kernel: [ 4385.493460] ata1.01: cmd a0/01:00:00:00:08/00:00:00:00:00/b0 tag 0 dma 2048 in Jul 27 22:33:31 vnx kernel: [ 4385.493461] res 01/60:00:00:00:08/00:00:00:00:00/b0 Emask 0x3 (HSM violation) Jul 27 22:33:31 vnx kernel: [ 4386.263553] ata1.01: status: { ERR }
Despite of the error trace, the commands are executed correctly. This error does not appear on Ubuntu 9.10 filesystems.