How to create bootable image of the entire OS for creating new EC2 instance?

0

I have a Linux OS installed on my local desktop. Is it possible to create a disk image of the entire OS (including all installed software and libraries and user files) and use it to create Amazon an EC2 instance similar to my local destop?

motam79

Posted 2018-08-27T17:27:06.487

Reputation: 300

Pretty sure the answer is “No…” but there is an aspect of an XY problem to this question. What is the exact benefit you hope to get by cloning a local Linux system install and imaging an EC2 instance with it?

– JakeGould – 2018-08-27T17:44:02.883

@JakeGould Why not? Seems possible to me. – iBug – 2018-08-27T17:47:12.700

If you full-clone your desktop Linux and apply the image to an EC2 instance, it won't work because of many incompatible things, including hardware, kernel and boot information, etc. – iBug – 2018-08-27T17:51:09.207

@iBug In one comment you say, “Seems possible to me.” but then you say in the next comment a few minutes late, “…it won't work…” Huh? – JakeGould – 2018-08-27T17:52:29.907

@JakeGould I think it's possible if you don't blindly clone the raw disk, but only some (but not all) files and programs. Thar summarizes to "a partial, file-based clone may work". – iBug – 2018-08-27T17:54:26.767

2

It can be done if you convert live filesystem to VMDK (VMWare's virtual disk) then import it to EC2. There're plenty examples like this how to convert Linux system from physical machine to VMDK image.

– Alex – 2018-08-27T18:39:23.787

Answers

0

You could but that wouldn't be optimal and you would need to make sure it had all the needed drivers.

Better to get the list of the packages you installed on your local desktop, then install the packages ontop of an ami of the same os(just make sure to remove any drivers from the list of packages). That way it will have the correct drivers.

Which distro?

ubuntu 14+ apt list --installed or dpg -l

fedora/centos yum or dnf list installed or rpm -qa

lxx

Posted 2018-08-27T17:27:06.487

Reputation: 101