yum install /usr/bin/virt-install virtio-win
virt-install \
--name 2016 \
--memory 8192 \
--vcpus 2 \
--cpu host \
--video cirrus \
--features hyperv_relaxed=on,hyperv_spinlocks=on,hyperv_vapic=on \
--clock hypervclock_present=yes \
--controller=scsi,model=virtio-scsi \
--disk /storage/2016.raw,bus=scsi,discard=unmap \
--disk /storage/windows.iso,device=cdrom,bus=ide \
--disk /usr/share/virtio-win/virtio-win.iso,device=cdrom,bus=ide \
--network network=default \
--graphics vnc,listen=0.0.0.0 \
--noautoconsole \
--os-type=windows \
--os-variant=win2k16
sconfig.cmd
cscript C:\Windows\System32\Scregedit.wsf /ar 0
Use pnputil /add-driver .inf
to install drivers which should be available on the ISO that is attached.
- https://github.com/DarwinJS/ChocoPackages/blob/master/openssh/readme.md#install-scenario-2-non-chocolatey-using-psh-5-packagemanagement
- Ignore #5, #6.
- Configure to use port 22
$address = "https://www.cloudbase.it/downloads/CloudbaseInitSetup_x64.msi"
$filename = "cloudinit.msi"
(new-object system.net).DownloadFile($address, $filename)
NOTE: DO NOT REBOOT
Modify C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init*.conf
- Add Setting password plugin
- Add
first_logon_behaviour=no
- Add
inject_user_password=true
NOTE: first_logon_behaviour set to no
will not require a password change at first logon.
qemu-img create -f raw cloudinit.img 1M
mkfs.vfat -n config-2 -I cloudinit.img
mkdir -p /mnt/config-drive
mount -o loop cloudinit.img /mnt/config-drive/
[root@jcallen-node4 config-drive]# tree
.
└── openstack
└── latest
├── meta_data.json
├── user_data
└── vendor_data.json
cp cloudinit.img /storage/pv16/disk.img
setfacl -m user:107:rwx /storage/pv16/disk.img
- With cloudbase-init
virtctl console <vm>
is availble with debug information of the cloudbase-init process. Run the command right after starting the virtual machine. - I really wish this would work:
oc exec virt-launcher-vm01-kfqxp -i -t -- virsh qemu-agent-command virtualmachine_vm01 '{"execute":"guest-network-get-interfaces"}'
error: argument unsupported: QEMU guest agent is not configured
- IP Addresses:
ssh admin$(oc get pod -l kubevirt.io/domain=vm01 --template '{{ range .items }} {{.status.podIP}} {{ end }}')
powershell -Command "& {Get-NetIPAddress | Format-Table}"
#one-liner...
ssh admin$(oc get pod -l kubevirt.io/domain=vm01 --template '{{ range .items }} {{.status.podIP}} {{ end }}') "powershell -Command \"& {Get-NetIPAddress | Format-Table}\""
where is /storage/2016.raw /storage/windows.iso, where cloud I download them? thanks.