How to make and run a Redhat 7.x (2.4 kernel) text-only server under xen without rebooting the orginal server

How to make and run a Redhat 7.x (2.4 kernel) text-only server under xen without rebooting the orginal server!



I want to test some developmental code on my live and in production server called Intranet. I can't break or reboot this machine. XEN to the rescue!
You are going to want serial console support in the kernel. Without it you will have trouble knowing when it is working under xen.
To add the serial support you will need to recompile the kernel. We will re-compile, but we will not reboot and will not be using the recompiled kernel on intranet!

Lets add the serial terminal shell support first:
and add (we will take this line out later, don't run init q, we don't want this to run right now): Now we want to allow root logins via our serial port: and add: Now its time to recompile our kernel to support serial terminals: enable "Support for console on serial port" under Character Devices-> Standard/generic (8250/16550 and compatible UARTs) serial support save/ok your way back to a prompt Now its time to edit lilo, don't worry, we will put it back the way it was
add (to the top section): modify the default (if it exists, add otherwise, you WILL be changing this back so remember the orginal setting): add (to the bottom section): Please note in the snippet above, we are using /dev/hda1 as the "root=". Xen emulates an IDE harddrive, so this is correct. There is an option in xen for supporting a scsi drive, but i was unable to get it to work as of xen-3.1.0-13.fc8.rpm

run lilo: you should see something like It is CRITICAL at this point that you do NOT allow the server to reboot. It may be okay, but if your kernel sources are out of sync with your kernel, it could be VERY BAD.

This is the fastest way i've been able to DD. It doesn't read/write on the same disk.
On a 100MB switched network i transfered an average of 1GB every 2minutes. or in other words it took me about 77 minutes to finish.
You might want to skip ahead and do the xen server setup stuff while this is running.
when the dd is complete (and ONLY when its complete!) undo the following
remove the stuff from /etc/lilo.conf (or just change default back to its orginal setting and comment out the append= and serial=)
remove the line from /etc/inittab (or just comment it out)
remove the line from /etc/securetty (or just comment it out)
run lilo:
you should see something like: XEN SERVER STUFF
Make (or copy an example and edit) /etc/xen/intranet.hvm
alot of this isn't really required, and yes you can hardcode the if and uname
Your done, run: and you should bootup!

You can hit "CTRL ]" to exit the serial console.
What? ifconfig has no eth0? Good point here is some more info

First things first, go disable cron, seriously, its probly going to do SOMETHING bad

You can comment these out also, but its nice for a programmer to see whats on the live machine without it running (or expecting it to).
You can stop the crond daemon itself also, i leave mine on though. People expect cron to work

Okay, your going to have to build the realtek 8139cp driver as a module. You might be asking why we didn't do this before?
Well, here is my good answer. If we had done this before, your VM copy would have come online and ip collided with your production server. Ha, pretty good reason eh?

So, change your network settings
Building the realtek 8139cp driver as a module.
enable as a module (letter M) "the Realtek 8139c+ PCI Fast Ethernet Driver" under Network Devices-> 100MB Cards save/ok your way back to a prompt now you will want to edit your modules.conf to autoload the network driver and add (or edit if you already have an alias eth0): Now you can do an ifup or restart the VM to enable networking. Setup the machine's ip and gateway just as if it was a normal machine.

Email me with suggestions/complaints/praise/etc