2

I've spent 3 weeks trying to solve this, but to no avail. I'm aware of the many posts on this topics.

I've already read and tried at least:

Migrate from a virtual machine (VM) to a physical system
Convert VirtualBox (VM) Machine TO Physical Drive
DD tutorial - how to clone, backup and restore disks and partitions
restore using dd will not boot

I've created a lubuntu 20.04 with certain packages and files in a VM. But I can't install it into a physical laptop (need to make many identical laptops with same configs). I can wipe all drives so I don't need to worry about dual boot.

Steps I've taken: VM system: virtual box 7.0 (created a lubuntu 20.04), 10Gb
Laptop system: 125Gb (want to install lubuntu 20.04 with files/packages)

  1. Created a lubuntu VM with fixed partition (not dynamic allocation)
  2. I've created an .img and tried both with VBoxManage... and dd within the VM.
  3. Booted into a Live usb installed lubuntu on the laptop disk then dd the img file into sda (the disk not sda1)

When I run lsblk the boot partition is missing unlike the results of Convert VirtualBox (VM) Machine TO Physical Drive.

  1. I've tried to offset and install the MBR but the VM does not have a boot partition only sda1
  2. I've tried install-mbr (but not in depth)

At this point and age I feel that this is important enough that there's a tool. It looks like that this question has been asked for over a decade.

Thanks : )

D. Ip
  • 23
  • 1
    This plan seems suboptimal for a number of reasons. A tool like FAI will make rapid deployments (and device reassignments) child’s play while also taking into account device-specific drivers that need to be installed on different models of hardware. Cloning a VBox image will just lead to excessive post-image work to clean up the remnants of the VM intermediary layer – matigo Apr 04 '23 at 14:23
  • As I recall, you need to start VBox before using the VBoxManage clonemedium command. – C.S.Cameron Apr 04 '23 at 14:43

1 Answers1

2

I have done it successfully on a non-UEFI machine (not claiming that it won't work on a UEFI machine, I just haven't tried it).

I used my go-to tool for such things, Clonezilla. I booted the VM using a Clonezilla .iso and cloned the disk to a shared drive on my server.

I then booted the physical machine using a Clonezilla thumbdrive and restored the clone off the server.

It worked fine. I did go in and remove the Guest Additions from the physical machine by going to /opt/VBoxGuestAdditions-(version) and running the uninstall.sh with sudo. (Guest Additions were causing a message to appear somewhere - I forget the details) I probably could have done that before cloning had I thought of it.

Organic Marble
  • 23,641
  • 15
  • 70
  • 122