View Full Version : Virtualize a physical server

21-05-2013, 12:01 PM
About a year and a half ago, I built a server, based on Debian, using an on-line guide; it works extremely well.
Then, about a year ago I built a new, more powerful computer, on which I installed "Proxmox". Using the above mentioned on-line guide I created a virtual server; this also works extremely well.

I would like to virtualize the first server and put it on my Proxmox machine. Then I only need one computer running (plus my win7 machine of course).

I've looked online and it all looks fairly complicated. Anyone got any thoughts?

21-05-2013, 01:51 PM
Just create a new vm and copy the old filesystem to it. Then just delete /etc/udev/rules.d/70-persistent-net-rules to clear out the old network interfaces and bbot it up.

21-05-2013, 02:21 PM
You can try P2V, I've never done it with Linux though but it's pretty straightforward with Windows.


21-05-2013, 07:07 PM
Thanks Fred. That looks simple enough. But copying the old file system, can you give me a bit of a "heads up" on that?
With this server, just after I got it up and running, I started doing cron jobs - backing up to an attached usb drive. In my ignorance I tried to back up / ...wrecked it!
So I'm cautious.

I have created a new vm on the Proxmox server. And I thought using samba I should get the files from a samba directory on the source server to a samba directory on the destination directory. Then it'd just be a matter of using webmin to put them into the new vm. Does that kinda make sense?

21-05-2013, 08:25 PM
Can be done with the source server running but you will need to exclude the various dynamically populated directories such as /sys /proc /dev and so, and create empty dirs for them on the target. Can be a bit fiddly and does have potential for inconsistencies if the source data is being written to while it is also being read, but generally does work.
Easiest is with it not running, booted from another medium.

Couple of ways - depends on the virtualisation method in Proxmox (which I've never used).
- Virtualbox has tools to do physical hdd or image to virtual container (vdi or such). Have just done this without issue from a dd image of a server.

Also depends if you are simply recreating the physical hdd virtually, or want to change the size/partitioning layout.

Easiest would be to boot both with UBCD or PartedMagic or some other image that contains udpcast, then just udpcast the physical source hdd to target the virtual hdd over the network. (also just done this succesfully to clone a running server - used the block device /dev/sda as the source rather than the running / filesystem).

Or create the virtual hdd and partitions and use rsync (again from a bootable environment) or with the source drive plugged into the host machine.

edit: ssh for file transfer would be HEAPS easier and more efficient than samba.

21-05-2013, 08:45 PM
edit2: looks like it may be able to use raw disk images, so you could just dd or udpcast to a file on your proxmox server then set that as the virt hdd image.

22-05-2013, 08:50 AM
Whew, that does look difficult for me. Even though I built the servers and all that goes with them.
The trouble is, I'm only a hobbyist/enthusiast who is curious about what can be done with linux and while I have a project on the go, I'm fine. But when the project's finished and I wander off to other things, I soon forget what it was all about.
I'd like to do this, but it might take time. I really do appreciate you taking the time Fred, to advise me on this. I take on board what you say about ssh being better.
As I go along do you mind me asking for help now and then?

The Proxmox machine has 2 x 1TB drives, which hold the vm's. One of which is my main backup and web server now. I also have 2 vm's on the 2nd drive; which are win8 (which I need to buy a licence for now - so I might get did of it) and a kind of copy of my main server which is, in my mind a "sandbox", which I hardly touch. Then there's the 3rd drive - 2 TB which holds snapshots of the vm's on the other drives - a brilliant feature! I tested it with the sandbox, by removing it completely and got it back again in just a few minutes.
I'm pretty well sold on Proxmox, but the machine does need a bit of "grunt". I built it with an i5 processor and 8 gb's of ram, which allows it to function quite well. The old saying "turn your old computer into a linux server" probably is not quite good enough for this sort of project.

22-05-2013, 09:17 AM
Yep, think about it, test some options and make a plan.

If, using proxmox, you can create a blank disk image and boot from an iso you are 80% done.

22-05-2013, 09:18 AM
I turned an old Pentium 4 into an Amahi server with 1.5Gbs RAM, mainly used as a backup facility and occasionally stream music from it. I made quite a few notes on how I did things such as mounting the drives creating the shares etc so that I can do it all again if I need to