Hello!
For those who are interesting in running TinyCore in OpenVZ I've prepared a template creation script.
It needs original tinycore_2.10.iso image,
iso-read utility (libcdio package in Fedora) to extract init ramdisk and
unsquashfs (squashfs-tools package) to install some extra .tcz into template:
- bash - OpenVZ scripts don't work with busybox shell
- dropbear - to have SSH access on boot
- squashfs-tools-4.0 - to unpack new .tcz
Unfortunately OpenVZ also doesn't support mounting squashfs images inside VE, so I've made mount script that just unpacks images to filesystem.
Next, OpenVZ doesn't call /opt/shutdown.sh (where I do backup) on VE stop, but this could be forced with /etc/vz/conf/106.stop script.
Usage:
- put attached scripts and tinycore_2.10.iso into $HOME directory
- run sudo sh vz.sh (sudo for /dev nodes creation on ramdisk unpacking)
- get tinycore-2.10-x86.tar.gz template and place it into /opt/vz/template/cache/ on the VZ server
- unpack tinycore-ovz.tar.gz into server's root (VE control scripts)
- create container:
$ sudo /usr/sbin/vzctl create 106 --ostemplate tinycore-2.10-x86 --ipadd 192.168.122.106 --hostname tinycore
$ sudo /usr/sbin/vzctl set 106 --save --nameserver 192.168.122.1 --name tinycore
(copy 106.stop to /etc/vz/conf/106.stop)
$ sudo /usr/sbin/vzctl start 106
$ sudo /usr/sbin/vzctl enter 106
I use 192.168.122.0/24 IP range for internal networking (maybe just default 192.0.2.0/24 will work?). To reach VE from workstations add firewall rule on the server:
sudo /sbin/iptables -A PREROUTING -t nat -s \! 192.168.122.0/24 -p tcp --dport 22106 -j DNAT --to-destination 192.168.122.106:22
And add to $HOME/.ssh/config:
Host tinycore
HostName vz-server
Port 22106
User tc
ssh -XY tinycore will enter tinycore VE with X11 forwarding.