Home How To Create a Virtual Machine on XCP-NG from the Command Line (Bash)
Post
Cancel

How To Create a Virtual Machine on XCP-NG from the Command Line (Bash)

Creating the VM Image

List Templates

1
xe template-list | grep "Windows Server 2022"

Create the VM

1
xe vm-install template="Windows Server 2022 (64-bit)" new-name-label="Windows Server"

Attaching the ISO

View the Available ISO’s

1
xe cd-list | grep 2022

Attached the ISO

1
xe vm-cd-add uuid=426b9683-a34e-6a83-cee5-d131fa5d66bf cd-name=Windows-Server2022.iso device=1

Configure the Networking

List Configured Networks

1
xe network-list

Create the Interface

1
xe vif-create vm-uuid=426b9683-a34e-6a83-cee5-d131fa5d66bf network-uuid=6740ed63-ab4b-e86a-01cb-b23c82fc6f12 device=0

Resize Disk

Get Disk UUID

1
xe vm-disk-list vm=426b9683-a34e-6a83-cee5-d131fa5d66bf

Resize Disk

1
xe vdi-resize uuid=de14deea-cbad-4428-9edd-fca87e2c634d disk-size=64GiB

Increase RAM

1
xe vm-memory-limits-set dynamic-max=4GiB dynamic-min=2GiB static-max=4GiB static-min=2GiB uuid=426b9683-a34e-6a83-cee5-d131fa5d66bf

Start VM

1
xe vm-start uuid=426b9683-a34e-6a83-cee5-d131fa5d66bf
This post is licensed under CC BY 4.0 by the author.