Create a Windows VM from ISO image in Google Distributed Cloud
Stay organized with collections
Save and categorize content based on your preferences.
This document shows you how to create a Windows virtual machine (VM) that boots
from an ISO using VM Runtime on GDC. When the VM boots, you manually
complete the Windows setup routine.
To successfully boot from a Windows ISO and complete the install process, the
VM needs access to the
virtio drivers. To provide the virtio drivers to the VM,
complete the following steps:
Create a VirtualMachineDisk manifest, such as virtio-driver.yaml, in the
editor of your choice:
This manifest pulls the latest virtio drivers from a public Docker repo and
sets the diskType as cdrom. Your VM uses this disk during the install
process.
Save and close the manifest in your editor.
Create the VirtualMachineDisk using kubectl:
kubectlapply-fvirtio-driver.yaml
Create a Windows VM
Create a VM that boots from the Windows ISO VirtualMachineDisk, and attaches
the virtio drivers disk:
Create a manifest that defines a VirtualMachineDisk for the boot volume and
a VirtualMachine, such as windows-vm.yaml, in the editor of your choice:
Replace VM_NAME with the name that you want for your VM.
This manifest creates a 100 Gibibyte (GiB) boot volume. As this boot volume is empty
when the VM first starts, the VM boots from ISO as a CD-ROM device to start
the setup routine. The virtio drivers are also attached to complete the
install process.
Save and close the manifest in your editor.
Create the VirtualMachineDisk and VirtualMachine using kubectl:
kubectlapply-fwindows-vm.yaml
Connect to Windows VM and complete OS install
The VM starts and boots from the Windows ISO in the previous section. Connect to
your VM and complete the Windows install process and configure your VM:
For more information about using kubectl virt vnc to connect to your VM, see
Connect directly using VNC.
In the Windows setup, choose to perform a Custom install.
Select Load driver, browse to the viostor directory on the virtio
disk, then select the directory that matches the version of Windows you want
to install.
With the storage and network drivers from virtio now available, complete
the rest of the Windows install process.
We recommend that you enable Remote Desktop Protocol so you can connect
directly to the VM after install.
Detach the ISO image and drivers disk
After the Windows install is complete, remove the virtio drivers disk and
Windows ISO image from the VM:
Stop your Windows VM:
kubectlvirtstopVM_NAME
Replace VM_NAME with the name of your Windows VM.
Use kubectl to edit the VM:
kubectleditgvmVM_NAME
Replace VM_NAME with the name of your Windows VM.
In your editor, update the spec.disks section to remove the Windows ISO and
virtio disks, as shown in the following example. The only disk left attached
to the VM should be the VM_NAME-boot-dv:
Make sure that your VM is in a Running state. If the VM isn't in a Running
state, check your VirtualMachine resource manifest to make sure you only
removed the Windows ISO and virtio disk. Check that the host has enough
compute resources to start your VM.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[],[],null,["# Create a Windows VM from ISO image in Google Distributed Cloud\n\nThis document shows you how to create a Windows virtual machine (VM) that boots\nfrom an ISO using VM Runtime on GDC. When the VM boots, you manually\ncomplete the Windows setup routine.\n\nYou can also create a Windows VM from a prepared disk image\n[using an HTTP source](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/create-manage-disks#from_image)\nor\n[from Cloud Storage](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/create-storage-credentials#use_a_secret_to_import_an_image).\n\nBefore you begin\n----------------\n\nTo complete this document, you need access to the following resources:\n\n- Access to Google Distributed Cloud version 1.12.0 (`anthosBareMetalVersion: 1.12.0`) or higher cluster. You can use any cluster type capable of running workloads. If needed, [try Google Distributed Cloud on Compute Engine](/kubernetes-engine/distributed-cloud/bare-metal/docs/try/gce-vms) or see the [cluster creation overview](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/creating-clusters/create-clusters-overview).\n- The `virtctl` client tool installed as a plugin for `kubectl`. If needed, [install the virtctl client tool](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/quickstart#install_the_virtctl_client_tool).\n\nCreate a virtual disk for the ISO image\n---------------------------------------\n\nTo successfully create a Windows VM, follow the steps and sections in this\ndocument in order.\n\nTo boot from a Windows ISO image, first create a `VirtualMachineDisk` with\n`diskType` of `cdrom`. Use your Windows ISO as the source for this disk.\n\n1. Create a `VirtualMachineDisk` manifest, such as `windows-iso.yaml`, in the\n editor of your choice:\n\n nano windows-iso.yaml\n\n2. Copy and paste the following YAML manifest:\n\n apiVersion: vm.cluster.gke.io/v1\n kind: VirtualMachineDisk\n metadata:\n name: windows-iso\n spec:\n source:\n http:\n url: \u003cvar label=\"img_url\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eIMG_URL\u003c/span\u003e\u003c/var\u003e\n size: 10Gi\n diskType: cdrom\n\n Replace \u003cvar translate=\"no\"\u003eIMG_URL\u003c/var\u003e with the HTTP path to your Windows ISO.\n You can also\n [create and use credentials to import an ISO from Cloud Storage](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/create-storage-credentials).\n3. Save and close the manifest in your editor.\n\n4. Create the `VirtualMachineDisk` using `kubectl`:\n\n kubectl apply -f windows-iso.yaml\n\nCreate a VM drivers disk\n------------------------\n\nTo successfully boot from a Windows ISO and complete the install process, the\nVM needs access to the\n[`virtio` drivers](https://wiki.libvirt.org/page/Virtio). To provide the `virtio` drivers to the VM,\ncomplete the following steps:\n\n1. Create a `VirtualMachineDisk` manifest, such as `virtio-driver.yaml`, in the\n editor of your choice:\n\n nano virtio-driver.yaml\n\n2. Copy and paste the following YAML manifest:\n\n apiVersion: vm.cluster.gke.io/v1\n kind: VirtualMachineDisk\n metadata:\n name: virtio-driver\n spec:\n size: 1Gi\n source:\n registry:\n url: docker://quay.io/kubevirt/virtio-container-disk:latest\n diskType: cdrom\n\n This manifest pulls the latest `virtio` drivers from a public Docker repo and\n sets the `diskType` as `cdrom`. Your VM uses this disk during the install\n process.\n3. Save and close the manifest in your editor.\n\n4. Create the `VirtualMachineDisk` using `kubectl`:\n\n kubectl apply -f virtio-driver.yaml\n\nCreate a Windows VM\n-------------------\n\nCreate a VM that boots from the Windows ISO `VirtualMachineDisk`, and attaches\nthe `virtio` drivers disk:\n\n1. Create a manifest that defines a `VirtualMachineDisk` for the boot volume and\n a `VirtualMachine`, such as `windows-vm.yaml`, in the editor of your choice:\n\n nano windows-vm.yaml\n\n2. Copy and paste the following YAML manifest:\n\n apiVersion: vm.cluster.gke.io/v1\n kind: VirtualMachineDisk\n metadata:\n name: \u003cvar label=\"vm_name\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eVM_NAME\u003c/span\u003e\u003c/var\u003e-boot-dv\n spec:\n size: 100Gi\n ---\n apiVersion: vm.cluster.gke.io/v1\n kind: VirtualMachine\n metadata:\n name: \u003cvar label=\"vm_name\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eVM_NAME\u003c/span\u003e\u003c/var\u003e\n spec:\n osType: Windows\n disks:\n - virtualMachineDiskName: \u003cvar label=\"vm_name\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eVM_NAME\u003c/span\u003e\u003c/var\u003e-boot-dv\n boot: true\n - virtualMachineDiskName: windows-iso\n - virtualMachineDiskName: virtio-driver\n compute:\n cpu:\n vcpus: 2\n memory:\n capacity: 4Gi\n interfaces:\n - name: eth0\n networkName: pod-network\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name that you want for your VM.\n\n This manifest creates a *100 Gibibyte (GiB)* boot volume. As this boot volume is empty\n when the VM first starts, the VM boots from ISO as a CD-ROM device to start\n the setup routine. The `virtio` drivers are also attached to complete the\n install process.\n3. Save and close the manifest in your editor.\n\n4. Create the `VirtualMachineDisk` and `VirtualMachine` using `kubectl`:\n\n kubectl apply -f windows-vm.yaml\n\nConnect to Windows VM and complete OS install\n---------------------------------------------\n\nThe VM starts and boots from the Windows ISO in the previous section. Connect to\nyour VM and complete the Windows install process and configure your VM:\n\n1. Connect to your Windows VM:\n\n kubectl virt vnc \u003cvar label=\"vm_name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of your Windows VM.\n\n When prompted, enter your\n [Windows guest OS user credentials](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/connect-vms#create_initial_user_credentials) for your VM.\n\n For more information about using `kubectl virt vnc` to connect to your VM, see\n [Connect directly using VNC](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/connect-vms#connect_directly_using_vnc).\n2. In the Windows setup, choose to perform a **Custom install**.\n\n3. Select **Load driver** , browse to the **viostor** directory on the `virtio`\n disk, then select the directory that matches the version of Windows you want\n to install.\n\n For more information, see\n [KubeVirt Windows `virtio` drivers](https://kubevirt.io/user-guide/virtual_machines/windows_virtio_drivers/).\n4. With the storage and network drivers from `virtio` now available, complete\n the rest of the Windows install process.\n\n We recommend that you enable Remote Desktop Protocol so you can connect\n directly to the VM after install.\n\nDetach the ISO image and drivers disk\n-------------------------------------\n\nAfter the Windows install is complete, remove the `virtio` drivers disk and\nWindows ISO image from the VM:\n\n1. Stop your Windows VM:\n\n kubectl virt stop \u003cvar label=\"vm_name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of your Windows VM.\n2. Use `kubectl` to edit the VM:\n\n kubectl edit gvm \u003cvar label=\"vm_name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of your Windows VM.\n3. In your editor, update the `spec.disks` section to remove the Windows ISO and\n `virtio` disks, as shown in the following example. The only disk left attached\n to the VM should be the \u003cvar scope=\"vm_name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e`-boot-dv`:\n\n apiVersion: vm.cluster.gke.io/v1\n kind: VirtualMachine\n metadata:\n name: windows-vm\n spec:\n osType: Windows\n disks:\n - virtualMachineDiskName: windows-vm-boot-dv\n boot: true\n interfaces:\n ...\n\n4. Save and close the VM manifest.\n\n5. Start your Windows VM:\n\n kubectl virt start \u003cvar label=\"vm_name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of your Windows VM.\n6. Check the `STATUS` of your VM:\n\n kubectl get gvm \u003cvar label=\"vm_name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of your Windows VM.\n\n Make sure that your VM is in a `Running` state. If the VM isn't in a `Running`\n state, check your `VirtualMachine` resource manifest to make sure you only\n removed the Windows ISO and `virtio` disk. Check that the host has enough\n compute resources to start your VM.\n\nWhat's next\n-----------\n\n- [Connect to VMs](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/connect-vms)\n- [Manage the power state of a VM](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/manage-power-state)"]]