grevelo.blogg.se

Hyperv ubuntu
Hyperv ubuntu












hyperv ubuntu

\focal-server-cloudimg-amd64.vhd -DestinationPath. Convert the image from VHD to VHDX using Convert-VHD (Powershell cmdlet for Hyper-V).\focal-server-cloudimg-amd64.vhd -srcformat qcow -dstformat vhd \focal-server-cloudimg-amd64.img -dstfilename. Convert the image from qcow2 to VHD using vbox-img.Make sure you have VirtualBox installed and in your PATH.If automating you probably want to replace -p with -q (quiet instead of progress).Convert the image: bash -c "qemu-img convert -p -f qcow2 -O vhdx focal-server-cloudimg-amd64.img focal-server-cloudimg-amd64.vhdx".Assuming Debian/Ubuntu WSL/WSL2, from a windows command prompt (Powershell or CMD) use: bash -c "apt update & apt install -y qemu-utils.Make sure qemu-utils is installed in your WSL/WSL2.Note that qemu-img for Windows currently has a known issue with vhdx files which is why we don’t use the native (Windows) version of qemu-img here. Convert the generic Ubuntu cloud image to VHDX Option 1: Using qemu-img in WSL/WLS2 The solution described here assumes you already have and know how to use Packer.įurther we assume the user running packer is a member of the ‘Hyper-V Administrators’ group.

hyperv ubuntu

  • Add the linux-cloud-tools-generic package to the image (this has the Hyper-V client daemons).Īn (mostly) automated solution Prerequisites for automation.
  • hyperv ubuntu

    Obtain a generic Ubuntu cloud image such as the daily Ubuntu LTS 20.04 (Focal Fossa) generic cloud image.The page I found that helped the most ( Enable Hyper-V Integration Services for your Ubuntu guest VMs) involves ‘manually’ modifying a generic Ubuntu cloud image, and I haven’t seen automated solutions for this, so I experimented, and now document my solution here. This means you cannot set a password or SSH key and therefore cannot login to the resulting instance. The Hyper-V images do not work with local / on-premises (Windows 10 / Windows Server 20xx) Hyper-V setups due to the included cloud-init only being configured to use the Azure datasource. There is a solution, and this page describes using it a mostly automated way using Packer. The official Ubuntu images that are built for Azure/Hyper-V really are only compatible with Hyper-V on Azure, despite Canonical (the company behind Ubuntu) offering Azure/Hyper-V disk images at Ubuntu Daily cloud images - Focal. Data files used with those cloud-init files.An update note on generating the ‘cloud-init’ ISO/CD.Create the required HCL2 template and files.Option2: Using vbox-img and Convert-VHD.Convert the generic Ubuntu cloud image to VHDX.














    Hyperv ubuntu