From 0cb7d5176e3c0522d10eb4963e0940f7c7faacdf Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Tue, 16 Sep 2025 08:27:31 -0400 Subject: build->linux && build-windows->windows --- build-windows.sh | 31 ------------------------------- build.sh | 42 ------------------------------------------ linux.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ windows.sh | 31 +++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 73 deletions(-) delete mode 100755 build-windows.sh delete mode 100755 build.sh create mode 100755 linux.sh create mode 100755 windows.sh diff --git a/build-windows.sh b/build-windows.sh deleted file mode 100755 index ed8bc74..0000000 --- a/build-windows.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -if [ "$#" -ne 1 ]; then - echo "Usage: $0 [vm_name]" - exit -fi - -VM_NAME="$1" - -VIRTIO_WIN="isos/virtio-win*.iso" -WINDOWS="isos/Win11_24H2_English_x64.iso" - -if [ ! -f $VIRTIO_WIN ]; then - pushd imgs - aria2c https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso - popd -fi - -sudo virt-install --import \ - --os-variant win11 \ - --name $VM_NAME \ - --ram 32768 \ - --cpu host-passthrough,cache.mode=passthrough \ - --vcpus 12,sockets=1,cores=6,threads=2 \ - --cdrom $WINDOWS \ - --disk path=imgs/$VM_NAME.img,format=raw,bus=virtio,size="256" \ - --video virtio \ - --graphics spice \ - --noautoconsole \ - --noreboot \ - --shmem name="looking-glass",model.type="ivshmem-plain",size=32,size.unit="M" diff --git a/build.sh b/build.sh deleted file mode 100755 index 5fc71aa..0000000 --- a/build.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -if [ "$#" -ne 2 ]; then - echo "Usage: $0 [vm_name] [ip_addr:192.168.122.x]" - exit -fi - -VM_NAME="$1" -IP_ADDR="$2" -AMD_GPU_RENDERNODE="/dev/dri/by-path/pci-0000:05:00.0-render" - -set -xe - -virt-builder debian-12 \ - -o imgs/$VM_NAME.img \ - --size 35G \ - --hostname $VM_NAME \ - -m 4096 --smp 4 \ - --run-command "ssh-keygen -A" \ - --append-line "/etc/network/interfaces:allow-hotplug enp1s0" \ - --append-line "/etc/network/interfaces:auto enp1s0" \ - --append-line "/etc/network/interfaces:iface enp1s0 inet static" \ - --append-line "/etc/network/interfaces: address $IP_ADDR" \ - --append-line "/etc/network/interfaces: gateway 192.168.122.1" \ - --run-command "apt-get update" \ - --run-command "apt-get install task-mate-desktop spice-vdagent qemu-guest-agent -y" \ - --run scripts/provision-root.sh \ - --ssh-inject compromyse:file:"$HOME/.ssh/id_rsa.pub" \ - --upload "scripts/provision-user.sh:/home/compromyse/install-nix.sh" \ - --write "/etc/resolv.conf:nameserver 8.8.8.8" - -sudo virt-install --import \ - --os-variant debian12 \ - --name $VM_NAME \ - --ram 8192 \ - --cpu host-passthrough,cache.mode=passthrough \ - --vcpus 4,sockets=1,cores=2,threads=2 \ - --disk path=imgs/$VM_NAME.img,format=raw,bus=virtio \ - --video virtio,model.acceleration.accel3d=yes \ - --graphics spice,gl.enable=yes,listen=none,gl.rendernode="$AMD_GPU_RENDERNODE" \ - --noautoconsole \ - --noreboot diff --git a/linux.sh b/linux.sh new file mode 100755 index 0000000..5fc71aa --- /dev/null +++ b/linux.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 [vm_name] [ip_addr:192.168.122.x]" + exit +fi + +VM_NAME="$1" +IP_ADDR="$2" +AMD_GPU_RENDERNODE="/dev/dri/by-path/pci-0000:05:00.0-render" + +set -xe + +virt-builder debian-12 \ + -o imgs/$VM_NAME.img \ + --size 35G \ + --hostname $VM_NAME \ + -m 4096 --smp 4 \ + --run-command "ssh-keygen -A" \ + --append-line "/etc/network/interfaces:allow-hotplug enp1s0" \ + --append-line "/etc/network/interfaces:auto enp1s0" \ + --append-line "/etc/network/interfaces:iface enp1s0 inet static" \ + --append-line "/etc/network/interfaces: address $IP_ADDR" \ + --append-line "/etc/network/interfaces: gateway 192.168.122.1" \ + --run-command "apt-get update" \ + --run-command "apt-get install task-mate-desktop spice-vdagent qemu-guest-agent -y" \ + --run scripts/provision-root.sh \ + --ssh-inject compromyse:file:"$HOME/.ssh/id_rsa.pub" \ + --upload "scripts/provision-user.sh:/home/compromyse/install-nix.sh" \ + --write "/etc/resolv.conf:nameserver 8.8.8.8" + +sudo virt-install --import \ + --os-variant debian12 \ + --name $VM_NAME \ + --ram 8192 \ + --cpu host-passthrough,cache.mode=passthrough \ + --vcpus 4,sockets=1,cores=2,threads=2 \ + --disk path=imgs/$VM_NAME.img,format=raw,bus=virtio \ + --video virtio,model.acceleration.accel3d=yes \ + --graphics spice,gl.enable=yes,listen=none,gl.rendernode="$AMD_GPU_RENDERNODE" \ + --noautoconsole \ + --noreboot diff --git a/windows.sh b/windows.sh new file mode 100755 index 0000000..ed8bc74 --- /dev/null +++ b/windows.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 [vm_name]" + exit +fi + +VM_NAME="$1" + +VIRTIO_WIN="isos/virtio-win*.iso" +WINDOWS="isos/Win11_24H2_English_x64.iso" + +if [ ! -f $VIRTIO_WIN ]; then + pushd imgs + aria2c https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso + popd +fi + +sudo virt-install --import \ + --os-variant win11 \ + --name $VM_NAME \ + --ram 32768 \ + --cpu host-passthrough,cache.mode=passthrough \ + --vcpus 12,sockets=1,cores=6,threads=2 \ + --cdrom $WINDOWS \ + --disk path=imgs/$VM_NAME.img,format=raw,bus=virtio,size="256" \ + --video virtio \ + --graphics spice \ + --noautoconsole \ + --noreboot \ + --shmem name="looking-glass",model.type="ivshmem-plain",size=32,size.unit="M" -- cgit v1.2.3