ispCP - Board - Support
[Howto] - UML to ispCP testing purposes - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Contributions Area (/forum-40.html)
+--- Forum: Howtos (/forum-41.html)
+--- Thread: [Howto] - UML to ispCP testing purposes (/thread-7682.html)



[Howto] - UML to ispCP testing purposes - Nuxwin - 08-28-2009 12:46 PM

Hi ;

I post here a small procedure which allows to install a virtual machine ( Debian Lenny with User-Mod Linux ) for ispCP testing purposes.

Here, I assume you use Debian (Etch or Lenny).

I. Installing needed packages

Code:
# aptitude update
# aptitude install uml-utilities umlrun user-mode-linux user-mode-linux-doc

I.a add your normal user in the uml-net group

Example :
Code:
# adduser nuxwin uml-net

II. Creating the workspace

Code:
$ mkdir -p ~/ispcp_uml/tools

III. Building the virtual drive

Code:
$ cd ~/ispcp_uml
$ dd if=/dev/zero of=lenny_rootfs bs=1M count=0 seek=3072

IV. Download netinstall iso (here, Debian lenny)

Code:
$ wget http://cdimage.debian.org/debian-cd/5.0.2a/i386/iso-cd/debian-502a-i386-netinst.iso

V. Downloading and decompressing perl scripts to extract the files in an iso

Code:
$ cd tools
$ wget http://stevieo.freeshell.org/uml/iso-perl-stuff.tar
$ tar -xf iso-perl-stuff.tar

VI. Extraction of the Debian installer from the iso

Code:
$ perl -Iiso-perl-stuff iso-perl-stuff/isocat.pl ../debian-502a-i386-netinst.iso \
install.386/initrd.gz > ../uml-initrd.gz

VII. Launch of the Debian installer in a UML instance

Code:
$ cd ..
$ linux mem=256M ubd0=lenny_rootfs ubd2r=debian-502a-i386-netinst.iso \
eth0=tuntap,,,192.168.0.110 \
root=/dev/ram rw ramdisk=10240 initrd=uml-initrd.gz \
netcfg/disable_dhcp=true hw-detect/start_pmcia=false debian-installer/probe/usb=false \
debconf/priority=low

Please, change the address Ip by your host system IP.

After running this command, the window diologue Debian Installer appears in the current terminal and 3 other virtual consoles are automatically created, two of them being shell.

VIII. Installation

Before doing anything through the Debian installer, you must mount the UML kernel modules as follow:

Select a virtual console (shell) and press enter. Then, run the following command:

Code:
UML# mount -o /usr/lib/uml/modules -t hostfs hostfs /lib/modules

This being done, return to the terminal of the Debian installer and follow each step.

1. Choose language :
Code:
English
other
Europe
France
en US.UTF-8
select : fr_FR.UTF-8, fr_FR, fr_FR@euro and select continue
Note : This is an example but you can override several values ( Europe, France... )

Do not select "Select a keyboard layout" step, jump to the next step.

2. Detect and mount CD-ROM :
Code:
No
No
yes
none
/dev/ubdc and Continue
Continue

3. Load installer components from CD :
Code:
Yes
Continue

4. Detect network hardware :
Code:
No

5. Configure the network :
Code:
No
Your virtual machine ip addresse ( ex: 192.168.0.130 ) and Continue
Your netmask ( ex: 255.255.255.0 ) and Continue
Your gateway (Here, must be the address Ip of your host system - ex 192.168.0.110) and Continue
Name Server addresses (you dns server(s) address(es) - see your host system /etc/resolv.conf file for this ) and Continue
Yes
Your Hostname (ex: ispcp) and Continue
Your domain name (ex: nuxwin.com) and Continue

6. Configure the clock :
Code:
Yes
Continue
Continue

7. Detect disks :
Code:
No

8. Partition disks
Code:
Guided - use entire disk
/dev/ubda - 3.2 GB User-Mode Linux UBD
All files in one partition (recommended for new users)
Finish partitionning and write change to disk
Yes

9. Install the base system
Code:
none

10. Setup users and passwords
Code:
Yes
Yes
Your user root password and Continue
Your user root password confirmation and Continue
Yes
Your normal user full name and Continue
Your normal user login name and Continue
Your normal user password and Continue
Your normal user password confirmation and Continue

11. Configure the package manager :
Code:
yes
http
France
ftp.fr.debian.org
Continue
Yes
Continues
Note: This is an example but you can override it with your personnal value (France, http://ftp.fr.debian.org)

12. Select and install software :
Code:
No
Continue

After this, jump to step "Continue without boot loader"

13. Continue without boot loader
Code:
Continue

14. Finish the installation
Code:
Yes
Continue

Finally, after reboot, type "halt" to halt the UML instance.

When this is done, your virtual machine is almost ready to be used.

IV. Import UML Kernel Modules

Start your virtual machine by running the following command::
Code:
$ linux mem=512M ubd0=lenny_rootfs eth0=tuntap,,,192.168.0.110 root=/dev/ubda1 ro

When this is done, it'll just log into a virtual consoles prompt.

After login, execute the following commands to import any UML kernel modules :
Code:
# mkdir /mnt/modules
# mount -o /usr/lib/uml/modules -t hostfs hostfs /mnt/modules
# cd /lib/modules
# cp -Rf /mnt/modules/* .
# umount /mnt/modules && rm -r /mnt/modules

Finally, type reboot to restart your virtual machine.

Your virtual machine is ready to use.

Note: It is also possible to use debootstrap instead of the debian installer and the netinstall iso image but my method has the advantage of not having to manually configure the virtual machine (swap, hostname, fstab, network ...).

Thank you for your feedback.

References :
http://stevieo.freeshell.org/uml/adminless-uml-d-i.html
http://www.debian.org/releases/stable/i386/ch05s03.html.en


Todo: How to compile the UML kernel with Debian.
Todo: How to applying skas3 patch to improve performance.


RE: [Howto] - UML to ispCP testing purposes - kilburn - 08-28-2009 03:43 PM

Great great great! I personally use VirtualBox, and store snapshots of "post base-install", "stable version", "trunk", or whatever I need atm.

As a suggestion, you could use debian's intaller automation to skip all installation questions, which would simplify the process even further Smile


RE: [Howto] - UML to ispCP testing purposes - Nuxwin - 08-28-2009 03:52 PM

(08-28-2009 03:43 PM)kilburn Wrote:  As a suggestion, you could use debian's intaller automation to skip all installation questions, which would simplify the process even further Smile

Thank you Shy

This is a great suggestion that I had not thought of! I'll try and make the necessary changes. Wink

I use virtualbox too. However, I think we can do much more with UML (automation)