Remote Ubuntu Dapper Drake Install

Don’t try this at home!

Well, actually, there are 2 ways you can look at it. Only attempt a remote install if it is absolutely necessary and there are no other practical ways of doing the OS install. It may be fun, and you’ll be impressed with yourself if you succeed, but the downside is that it takes a lot more time to do it remotely, it can be pretty tough on your nerves while you wait for the machine to come back up, eventually, and that’s it ever does. I can imagine a lot of things going wrong…

On the other hand, that’s exactly what you want to do. Do it from home instead of driving to the office, or better yet, to some hosting facility way out somewhere.

Anyway, now you’ve been warned and if you are still reading, here’s the challenge I was facing.

I had a machine (not the fastest, but a machine) with an old version of Linux. So old the distribution is no longer updated, and I’m not really that familiar with it anyway. So I had been itching to reinstall either a version of Debian or a version of Ubuntu Dapper as my choice of late. Plan B is having to drive to the data center, extract the machine, take it back, do the install, drive back to the data center, reinstall the machine, … and Plan B was not something I was looking forward to.

So I did some research, and using Google, it is fairly obvious that the article by Erik Jacobson that you should read first if you want to attempt any remote install of debian is the authority on the subject. Read the HOW-TO.

I could not find anything on Ubuntu, however. And I even found a few reports of people upgrading from debian to Ubuntu having troubles, but mostly from XWindows stuff, but for a server, that’s not something I was interested in. And worst case, I’d be on my driving to that data center…

So I read the HOW-TO carefully, a few times to let it sink in, and got started on my Ubuntu Dapper Drake (6.06) remote install.

Here’s what I did.

I first followed the procedure in the HOW-TO to install debian. At some points, there are a few differences that I’ll highlight. Here are some notes I took while doing the install.

I used the rpm from [http://azhrarn.underhanded.org/debootstrap-0.2.23-1.i386.rpm]()

I used the swap partition as a new boot partition for debian.

The old distribution did not support journaling, so I only used (this is only the boot partition anyway, so journaling is not as important, and that one will be temporary anyway):

mke2fs /dev/hda6

NOTE: identify your volume names at the beginning, create a table to help you translate between what the HOWTO uses, what I use and your setup otherwise you might be in for some serious trouble.

debootstrap does not support sarge, so using woody was fine. The only thing we’ll be using the bootstrap is to get apt working.

Follow the steps till you reach the part where you get apt working. Then no need to bother with netselect (didn’t work for me), now is the time to do a bit of tinkering.

Edit /etc/apt/sources.list and replace it with:

vi /etc/apt/sources.list
deb http://us.archive.ubuntu.com/ubuntu/  dapper main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/  dapper main restricted

deb http://us.archive.ubuntu.com/ubuntu  dapper universe
deb-src http://us.archive.ubuntu.com/ubuntu  dapper universe

#deb http://mirrors.kernel.org/debian/ stable main non-free contrib
#deb-src http://mirrors.kernel.org/debian/ stable main non-free contrib
#
#deb http://debian.yorku.ca/debian/ stable main non-free contrib
#deb-src http://debian.yorku.ca/debian/ stable main non-free contrib
#deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free
#deb-src http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free
#
## deb http://security.debian.org/ stable/updates main contrib non-free
#deb http://security.debian.org stable/updates main contrib non-free

Next, proceed with the update and dist-upgrade, then install a kernel.

apt-get update
apt-get dist-upgrade
apt-cache search kernel-image

Find a 2.6 kernel for your system (unless you insist on using 2.4).

Then proceed back with the rest of the script, starting with the install of ssh.

To make sure ssh was configured properly, I configured it on a different port so I could try it before the first reboot. Having everything working, but not ssh would be real bad, so spending some extra time here is worth it.

And one thing you want to take the time to do is to setup a cron job that will reboot the new system after some time (say every 2 hours), as an extra insurance, in case something wrong happens. Here’s a possible line to add to your crontab to reboot every 2 hours:

00  */2 * * * /sbin/shutdown -r now

I did mess up once, and I was really glad to see the machine come back after a very long 2 hours or so (I had almost given up on it and was getting ready to plan B). The second insurance you can take is to setup the reboot on the new kernel as a temporary reboot (as explained in the HOW-TO), you might be glad you did.

Once your reboot is successful, it is a matter of replacing the main partition with ubuntu, do the second reboot, and voila! Phewww! Not something I’d like to do everyday, but I’m glad I did it once.

Now you have a very barebone version of Ubuntu Dapper and you can customize it any which you need.

Good luck on your remote install!

Installing Ubuntu Dapper on Parallels running on Tiger

After my success with installing Windows XP on my shiny new iMac, I tried to install Ubuntu Dapper (a.k.a. Dapper Drake). Why would I want to install Linux on a Mac? Because that’s what I’m running on my server, so I need a sandbox where I won’t risk breaking real stuff.

Anyway, I created a new VM, chose Linux as the Guest OS Type, and Debian Linux as the Guest OS Version (since Ubuntu is derived from Debian and was most likely the closest).

Next, I put a CD of the latest Ubuntu install (Server Version: 6.06). Using mostly the defaults all along, the installation went smoothly. The only part were I went fancy was to use LVM (Logical Volume Manager). Everything went smoothly till it was time to reboot the machine…

The reboot went fine till after it was done uncompressing the kernel. Then it froze! Ouch.

From there, it was a lot of testing of various options, versions of Linux, even redid a full install without LVM. Nothing made any difference! So, I went ahead and tried to install Sarge (Ubuntu 3.1). This went like a breeze and worked the first time around (after all, Parallels officially supports Debian). So I was feeling a bit better…

… and went on to do some more research. And read that some people had had some luck with the Live CD (I had used the server CD since I wanted a permanent installation). So after a little while the download was over, and I booted the LiveCD, and it worked! Hurray! Bring on the champaign… Hold on, we are not quite there, but keep it in a nice cool place… Just in case…

And after playing for a while, just starring at me on the desktop was an “install” icon, so I figured, just one more try would not hurt. I went through the installation, and was bracing myself for the freeze right after the kernel gets uncompressed, but lo and behold! It did not freeze. Wow! Home free at last.

Ok, yes, you can bring on the champaign now.

Not sure what’s different about the 2 installers, but I don’t think I’ll try to figure it out. If anyone knows, would you let me know, please?

Note: this is my first post done using TextMate Blogging Bundle, so this may have a few hiccups…
In case you were wondering what the xmlrpc URL is for typo, it is /backend/xmlrpc (Thank you Damien)