WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Can I virtualise Tiny Core?  (Read 3408 times)

Offline PingPing

  • Jr. Member
  • **
  • Posts: 99
Can I virtualise Tiny Core?
« on: June 06, 2009, 11:33:22 AM »
I 'virtually' know nothing about virtualisation but I'm hoping it can do what I want.
I would like to use a single machine (CPU,RAM,etc) to run two 'virtual' machines: one a TCL webserver, the other a TCL samba server.
Could someone please tell me if this is possible and any tips on how to do it?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Can I virtualise Tiny Core?
« Reply #1 on: June 06, 2009, 12:14:41 PM »
Yes. What's your host OS?
Any preference with virtual machine software?
The only barriers that can stop you are the ones you create yourself.

Offline PingPing

  • Jr. Member
  • **
  • Posts: 99
Re: Can I virtualise Tiny Core?
« Reply #2 on: June 06, 2009, 03:52:14 PM »
Yes. What's your host OS?
I don't have a preference.  Can Tiny Core be it?
Quote
Any preference with virtual machine software?
No.  I would just like something that's command-line driven and (if possible) easy to set up.

I'll be working with a total of 1.25GB of RAM and a single 1GHz VIA CPU (no hardware virtualisation), but as both the web server and the samba server won't be serving up pages/files for most of the day I figured even these modest hardware specs should be okay for what I want.  I was thinking 512MB for the host OS, 512MB for the samba server and 256MB for the web server.
« Last Edit: June 06, 2009, 04:29:10 PM by PingPing »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Can I virtualise Tiny Core?
« Reply #3 on: June 06, 2009, 05:21:57 PM »
With modest hardware, I do need to ask is there something specific requiring virtualization? It would be much faster running both servers on the metal.

If you decide to go with virt, TC can be the host; so far there's only Qemu available as an extension though.

Qemu is pretty simple to use, here's how to run the latest iso, while setting ram to 256mb, and enabling access to port 80 (web server):

qemu -cdrom /path/to/tinycore_2.0rc4.iso -m 256 -redir tcp:80::80

This redirects your host machine's port 80 to the virtual machine, allowing it be a web server in your lan.

Since Qemu uses the shared memory for its RAM, you might need to up the max limit (the default is half your ram):
sudo mount /dev/shm -o remount,size=1024M
The only barriers that can stop you are the ones you create yourself.

Offline PingPing

  • Jr. Member
  • **
  • Posts: 99
Re: Can I virtualise Tiny Core?
« Reply #4 on: June 06, 2009, 05:35:59 PM »
With modest hardware, I do need to ask is there something specific requiring virtualization? It would be much faster running both servers on the metal.
I'm paranoid about someone cracking my web server and getting into my LAN.  I currently run two separate machines on two separate subnets with the samba server behind its own firewall.  I'm hoping I can do the same, effectively, with virtualisation but have one physical machine instead of two.

Thanks for the QEMU tips.

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: Can I virtualise Tiny Core?
« Reply #5 on: June 06, 2009, 07:52:12 PM »
VMware works well when you don't have hardware virtualization. You might try running ESXi. I run lighttpd (I have an extension for it I've not yet submitted) in only 128MB RAM with excellent performance, although the server does have virtualization extensions.

I like the chroot feature of lighttpd. I don't have a samba server (I plan to use ZFS/Nexenta for that), but I do use the chroot feature of scponly to share files via sftp/scp.

I think paravirtualization rather than full virtualization is better suited for simple services like yours, but I've not had the time to investigate it. Linux-VServer looks hopeful, but it is experimental at the moment. BSD chroot jails might even be worth investigating.

Offline PingPing

  • Jr. Member
  • **
  • Posts: 99
Re: Can I virtualise Tiny Core?
« Reply #6 on: June 07, 2009, 03:20:43 AM »
BSD chroot jails might even be worth investigating.
You read my mind. curaga's comment about being much faster running both services on the same machine had me thinking overnight and I woke up this morning thinking it might be a whole lot easier if I try and chroot-jail the apache daemon.  OpenBSD does it by default and, as you've pointed out, FreeBSD has their 'jail' feature.  So, at this stage, I'm going to look into jailing httpd on tinycore rather than virtualise a separate machine.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Can I virtualise Tiny Core?
« Reply #7 on: June 07, 2009, 05:52:12 AM »
Creating chroot jails on TC is a lot easier than in other places, simply because here you don't need to strip things to save space, just copy everything to a subdirectory ;)
The only barriers that can stop you are the ones you create yourself.