Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

forward-deploy-vm

Take a vmdk and burn it to a physical disk to transition from a virtual machine to a physical one.

Warning

This could very easily delete your data if used incorrectly or delete your operating system. Use at your own risk. The author takes no responsibility for damage caused by using this code.

Script Steps:

  • Mount a provided VMDK file using the network block device kernel module
  • Choose a partition
  • Choose a block device to write to (should be a partition on a physical disk)
  • dd the VMDK partition into the chosen block device

User Steps:

  • Run script
  • Linux deployments: sudo update-grub to show on boot menu (or just use rEFInd to skip this)
  • Windows deployments:
    • Boot to WinRE command line and run:
    • bootrec /scanos > this should show you your forward deployed installation drive letter
    • bcdboot <DRIVELETTER>:\Windows /d /addlast

Usage

Usage: fwd-deploy.sh [options] 

Forward deploy a VM image to a block device.

Options:
  -h, --help         Show this help and exit.
  -V, --vmdk VALUE   Path to the vmdk file to deploy (required)
  -p, --partition VALUE Partition number to burn (from vmdk) (required)
  -b, --block-device VALUE Block device to deploy to (e.g. /dev/sdb) (required)
  -y, --yes          Automatically confirm all prompts [default: 0]

Usage (fwd-deploy-interactive)

This is interactive and will prompt for any options not provided

Usage: ./fwd-deploy-interactive.sh [options] 

Forward deploy a VM image to a block device.

Options:
  -h, --help         Show this help and exit.
  -V, --vmdk VALUE   Path to the vmdk file to deploy (optional)
  -p, --partition VALUE Partition number to burn (from vmdk) (optional)
  -b, --block-device VALUE Block device to deploy to (e.g. /dev/sdb) (optional)
  -y, --yes          Automatically confirm all prompts [default: 0]

dev notes

Built and tested on Ubuntu 25.10. I recommend using rEFInd to avoid updating grub. Windows VMs do work after manually updating the Windows BCD post-deployment. I was successful with burning a VMDK hosted on a NAS to a local partition, so as long as you can access the VMDK file somehow (local/usb/network), you should be able to burn it to a local partition.

I personally have a partition called "FORWARD" dedicated to deploying a VM. With rEFInd, it is as simple as burning the VM and rebooting to that partition since most Linux kernels can boot themselves. In other cases you'll need to update grub after the burn.

About

Take a vmdk and burn it to a physical disk to transition from a virtual machine to a physical one

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages