I have been running a virtual machine of Debian sarge under VMware at work. I have eventually convinced the geeks around here a Debian machine would make a nice addition to the network.

It took quite a lot of whining and fits over stupid RPM packages. It is such a nightmare to find packages for the things I need. There are several RH machines at work and they’re all horribly out of date because it is so difficult to upgrade them.

I had real difficulties building CVStrac on a RH9 machine (for the Joel test ) and in the end people went with the Debian server. I offered to get the network clients going properly with DHCP, instead of guessing a local address that might not be taken.

The Debian dnsmasq package did the trick here. It is so sweet and simple (without resolvconf), DNS and DHCPd in one. I put in the critical/server machine names in /etc/hosts whose IPs are between 192.168.0.1/50 and setup the rest of the network in /etc/dnsmasq.conf to get an IP over .50 from the dhcpd in dnsmasq. No more BIND on an ancient machine.

There were some strange problems when I /etc/init.d/networking restart the Debian machine to take over the DNS. The NFS mounts came up with permission denied errors, though their orginal exports were for the entire local network. A remount solved the problems. Since the cvstrac IP changed with Debian, the windows machines needed a ipconfig /flushdns. Pretty painless overall, considering it is afterall DNS.

Since I have Debian under WinXP in VMware becoming more and more important, I now have a physical machine to put it on. But, urm… I don’t want to install Debian all over again and copy the files. Is there some easier way from VMware to a live physical machine?

24.20.137.75

Here’s what I’d do (I’m not saying it’s the ideal solution, it’s just the one I think of first):

Take the hard drive from the real machine and put it into your WinXP+VMware box. Set up that drive to be a physical disk under VMware. Make a filesystem on the drive and mount it somewhere, say /target.

Now rsync everything over:
rsync -vSHaxP / /target

That command won’t cross filesystem boundaries, so if you have other filesystems, you’ll need to rsync those too, e.g.:
rsync -vSHaxP /var /target

(Make sure NOT to include the trailing slash on your other filesystems… e.g. ”/var”, NOT ”/var/” !!)

Now everything should be copied over. All that’s left is the master boot record. Put the drive back in your real machine, boot from a debian boot CD (“linux root=/dev/hda1”) and then reinstall lilo or grub on the drive.

Hopefully that should work!

Comment by Michael P
61.9.136.168

If I am going to rsync it, I might as well boot the “real” machine with a Live-CD and rsync via the Gigabit ethernet.

Though I am not sure how to partition the hard drive on the real machine.

Hmmm, a sense a feature request for the debian-installer.

Comment by hendry
213.174.253.7
i would use dd an copy the vmware partions somewhere. then partion the real server exactly like the vmware, and copy the partions using dd again. (and MBR). maybe later try to make partions on real server bigger (probably has more space)
Comment by vittorio
198.182.56.5
Just get apt for your Red Hat boxes; it’s available and it works, and then keeping the Red Hat boxes upgraded will be as easy as it is for Debian.
Comment by Joe Buck
61.9.136.168

Thanks for the comments everyone.

bootcd says:

—- Sizes in KByte (du -klsc )—-
NOT_TO_CD = . . . . . . . . . . . . . . . . . . . . . . . . . . . 0
CD_ALL (SRCDISK v NOT_TO_CD) = . . . . . . . . . . . . . . . . . . 5931620
Needed = CD_ALL – NOT_TO_CD . . . . . . . . . . . . . . . . . . . 5931620
CD (650 MB) = . . . . . . . . . . . . . . . . . . . . . . . . . . 665600
—- WARNING—-
SRCDISK does not fit on CD (Needed > CD)
—- (e)xit (i)gnore—- e

So I am going to download the sarge netinst. Set up a base machine. And then rsync and get the selections of my vm Sarge.

Comment by hendry
67.189.77.103
You need to include the x option for rsync… x tells it not to cross filesystem boundaries, thus skipping over /proc, /mnt, etc.
Comment by Michael P