www.encoco.net

How to clone a Virtual Linux Machine to a Physical Machine using DD and NETCAT

I tried and accomplished this in many different ways. I now did it in a new way as it does not require a lot of preparation. It does not require remote root access tricks or chroot tricks, but it is not good for per file transfere and also requires a dedicated target disk with enough space.

Remeber to replace sdx1 and sdy1 with your value, DEST with the destination ip address. 10000 would be the communication port. Also ROOT is required!

Start a Linux with the target disk attached and enter the following command:
WARNING this destroys the content of the target disk!

(nc = NETCAT)
nc -l -p 10000 | dd of=/dev/sdx1

Start the Virtual Linux System and enter following command:

dd if=/dev/sdy1 | nc DEST 10000
Before booting the machine, we need to make sure the system partition will be found. We therefor change the UUID of the partition. Changing the UUID entry in /etc/fstab didn't work. It causes problems with GRUB seeing an EXT2 system instead off EXT4, or the System Partition not found or GLIBC... not found etc.
Now retrieve the expected UUID like this or get it from the Source Machine:
mkdir x
mount /dev/sdx1 x
vi x/etc/fstab 
# copy UUID of mount Point / to clipboard
umount x
rmdir x
Now set the UUID of the partition
e2fcsk -f /dev/sdx1
tune2fs -U UUID /dev/sdx1

This is all. The copied System should boot now

BTW:
  • One could use this for a Virtual Windows System as well. The procedure could be adjusted
  • If desired the partion size can be increased of course
  • Tested on Ubuntu 22.04 January 2026


More Tips
· HOME · Top · Data Protection · Legal ·

Smarte Lösungem. Für alle Plattformen



  
Width :

Language:





      Accept Cookies 