WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TinyCore OpenVZ template and setup hints  (Read 5268 times)

Offline grisxa

  • Newbie
  • *
  • Posts: 27
TinyCore OpenVZ template and setup hints
« on: April 16, 2010, 03:47:15 AM »
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:
    Quote
    $ 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:
Quote
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:

Quote
Host tinycore
        HostName vz-server
        Port 22106
        User tc
ssh -XY tinycore will enter tinycore VE with X11 forwarding.

Offline alexko

  • Newbie
  • *
  • Posts: 2
Re: TinyCore OpenVZ template and setup hints
« Reply #1 on: February 28, 2011, 11:00:53 AM »
Hi does this installation script working with microcore 3.5 ? I want to build a Openvz Image for Proxmox see me Post here...

http://forum.tinycorelinux.net/index.php?topic=8870.0

Offline peter712

  • Newbie
  • *
  • Posts: 1
Re: TinyCore OpenVZ template and setup hints
« Reply #2 on: July 16, 2011, 05:32:15 PM »
so I'm new to TC and for the most part still a novice with linux so I maybe missing bits and or misunderstand something.

so far as I have gotten tinycore 2.10 to run as an openvz container but Proxmox doesnt like it at all. although I did create it on the proxmox host (debian) not on fedora
          currently unable to set root password with proxmox
          unable to access via ssh (do to unable to set root password... I think)
          unable to reboot via the command line.


the scrips will need to be rewritten/updated to work on current tinycore or microcore versions. but BIG PROPS Grisxa for making them!!!!  I am currently working on updating them.

possible issues with proxmox. per the wiki http://wiki.tinycorelinux.net/wiki:custom_kernel   there are patches needed for TC to work with the standard kernel. I dont know what they are and so I dont know if they are in the proxmox kernel.  if they are missing, I have no idea how to add them other then ask the dev's to add it to there kernel, witch I doubt they will do without a working template.  


is what I've got so far, any help is welcome.
    Peter
« Last Edit: July 29, 2011, 06:45:09 PM by peter712 »