You are not logged in.

#1 2009-11-18 09:27:09

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

"jeos" - Ubuntu in a box (for web developers)

Have you ever tried to get things like kepler or sproutcore working on Arch? I did and failed, because Arch's software versions are too new and somehow break things. (luarocks failed first with op.cgi and later on kepler post_install, parts of sproutcore fail with ruby 1.9)

Sure, there are probably ways to fix this, but sometimes it's just nice to have some things working consistently and on the same time enjoy the currency and flexibility of Arch.


Enter jeos - my take on solving this problem.

What is jeos? jeos is just a wrapper around a minimal Ubuntu vm, making it almost as if it was running on your machine.


Quick Recipe:

1. Download Ubuntu Server Edition
2. Install VirtualBox (help) and install Ubuntu. In the start screen, press F4 and select "install minimal virtual machine". Make sure to install the ssh-server during setup.
3. Edit the virtual machine xml configuration file. (to be found in ~/.VirtualBox, I believe, its in vm name/vm name.xml) Add the following lines inside the <ExtraData>-tag.

      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" value="2222"/>
      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" value="22"/>
      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" value="TCP"/>
      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort" value="8888"/>
      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort" value="80"/>
      <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol" value="TCP"/>

You can now ssh into the vm using ssh -p 2222 localhost and access web servers running on port 80 inside the vm via http://localhost:8888. Adjust and add new entries as needed.
4. Create a ssh keypair (help) and scp the public key into the file ~/.ssh/authorized_keys2 on the virtual machine. You can now login without entering a password.
5. Create a script called "jeos", make it executable and place it in $PATH. In my case the content is the following: ("Ubuntu 9.10 JEOS" is the name of the vm)

#!/bin/bash

VBoxHeadless -startvm "Ubuntu 9.10 JEOS" > /dev/null &
sleep 2 # give the vm some time to start
ssh -p 2222 localhost

Voila - now you can execute jeos in a terminal and you will be greeted by a cli for the vm.

First start will take about 15 seconds (make sure to adjust grub config in the Ubuntu vm), later it's just like a normal ssh connection.
Unless you're short on RAM, you can leave the VM running in the background, it will take 0-1% CPU when idle. (C2D@800MHz)

Offline

#2 2009-11-18 09:34:00

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: "jeos" - Ubuntu in a box (for web developers)

you know that you don't have to do that extra step if you configure your VM to use bridge rather than NAT? you just do ssh ip


Give what you have. To someone, it may be better than you dare to think.

Offline

#3 2009-11-18 10:34:37

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: "jeos" - Ubuntu in a box (for web developers)

You are completely right, although I think it's cleaner with NAT (just personal preference).

Instructions to set up the bridge are in the Vbox wiki article I linked, you can skip step 3 then and have to use the vm's IP instead of localhost.

Offline

Board footer

Powered by FluxBB