Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm looking for information how to transfer my physical server running debian into a VirtualBox machine running on my Win7 desktop.

My gut feeling is to simply recreate the partition table of the hard drive in the server and then copy all of the content. However I have no idea if this will actually boot.

I also don't know how debian reacts on waking up in a totally different environment.

Any ideas or tips? Ideally I wouldn't have to shut the server down until I can verify that everything works in the virtual machine.

share|improve this question
    
+1 Excellent question. Migrating real to virtual hardware is a pretty standard procedure where some tooling could go a long way. I mean the tool could analyze the hard disk (identify the boot manager in the MBR, locate the partitions in /etc/fstab). Still I also haven't seen anything which can do that. –  Aaron Digulla Aug 22 '12 at 7:58

1 Answer 1

up vote 2 down vote accepted

Moving all the files from one file system to another is not a problem. If just the files and permissions are the same, Linux will not care if the underlying hardware, filesystem type etc has changed. But Grub will, so you need to reinstall that.

If you like you can just make an image of your whole disk and convert it to a VirtualBox disk (using VBoxManage convertfromraw mydisk.img mydisk.vdi). This will work without reinstalling Grub. But of course every other partition gets included too (which might make the file too big and unpractical). Gparted or the like can then be run from inside VirtualBox to edit the partitions.

Moving Linux to new hardware generally works fine. According to my experience the only thing needing some tweaking has been the X server configuration. But since you are running a server it's probably not even an issue. The new network adapter (as Linux sees it) will propably get a new number (for example eth1 in stead of eth0) so any explicit routing rules need to be updated (but you can tell udev to use old number, avoiding any problem, see this question).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.