Compare commits
No commits in common. "42f9b20c255db0f5990c7f6376ec9849ee646310" and "c96fd4bee7696ccdae4b75517142f9a38f2b3d2b" have entirely different histories.
42f9b20c25
...
c96fd4bee7
@ -1,18 +0,0 @@
|
|||||||
#!/bin/bash -e
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
. ./lib.sh
|
|
||||||
|
|
||||||
if [ -f hda.qcow2 ]; then
|
|
||||||
echo -e "Disk file exists. Are you sure you don't want" \
|
|
||||||
"\e[1m\e[31m./run.sh\e[0m?\nCtrl-C to interrupt" >&2
|
|
||||||
read -r
|
|
||||||
fi
|
|
||||||
|
|
||||||
qemu-img create -f qcow2 hda.qcow2 10G
|
|
||||||
|
|
||||||
CMD=(
|
|
||||||
"${CMD[@]}"
|
|
||||||
-drive file=arch.iso,index=1,media=cdrom,readonly=on
|
|
||||||
)
|
|
||||||
|
|
||||||
"${CMD[@]}"
|
|
@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash -e
|
|
||||||
|
|
||||||
arch=''
|
|
||||||
|
|
||||||
curl -LC- \
|
|
||||||
-o arch.iso "$arch"
|
|
23
arch/lib.sh
23
arch/lib.sh
@ -1,23 +0,0 @@
|
|||||||
#!/bin/bash -e
|
|
||||||
|
|
||||||
RAM="$(free -g | awk '/^Mem:/{print $2 - 2}')"
|
|
||||||
|
|
||||||
if [ "$RAM" -le 2 ]; then RAM=2
|
|
||||||
elif [ "$RAM" -gt 32 ]; then RAM=32; fi
|
|
||||||
|
|
||||||
RAM="${RAM}G"
|
|
||||||
|
|
||||||
CMD=(
|
|
||||||
qemu-system-x86_64
|
|
||||||
-accel kvm
|
|
||||||
-M q35
|
|
||||||
# usb
|
|
||||||
-device qemu-xhci
|
|
||||||
-cpu host
|
|
||||||
-m "2G,maxmem=$RAM"
|
|
||||||
-vga virtio
|
|
||||||
#-drive if=virtio,file=hda.qcow2
|
|
||||||
# shared memory
|
|
||||||
-object memory-backend-ram,id=mem,size=2G,share=on
|
|
||||||
-numa node,memdev=mem
|
|
||||||
)
|
|
12
arch/run.sh
12
arch/run.sh
@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash -e
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
. ./lib.sh
|
|
||||||
|
|
||||||
CMD=(
|
|
||||||
"${CMD[@]}"
|
|
||||||
-nic user,model=virtio-net-pci
|
|
||||||
# usb passthrough, might need root privileges
|
|
||||||
#-device usb-host,vendorid=0x058f,productid=0x6387
|
|
||||||
)
|
|
||||||
|
|
||||||
"${CMD[@]}"
|
|
@ -12,8 +12,8 @@ qemu-img create -f qcow2 hda.qcow2 40G
|
|||||||
|
|
||||||
CMD=(
|
CMD=(
|
||||||
"${CMD[@]}"
|
"${CMD[@]}"
|
||||||
-drive file=win2k22.iso,index=1,media=cdrom,readonly=on
|
-drive file=win2k22.iso,index=1,media=cdrom,readonly=on \
|
||||||
-drive file=virtio.iso,index=2,media=cdrom,readonly=on
|
-drive file=virtio.iso,index=2,media=cdrom,readonly=on \
|
||||||
#-drive file.driver=http,file.filename=http://example.com/image.qcow2
|
#-drive file.driver=http,file.filename=http://example.com/image.qcow2
|
||||||
-nic none # you don't want internet access for a windows installation
|
-nic none # you don't want internet access for a windows installation
|
||||||
)
|
)
|
||||||
|
@ -10,14 +10,16 @@ RAM="${RAM}G"
|
|||||||
CMD=(
|
CMD=(
|
||||||
qemu-system-x86_64
|
qemu-system-x86_64
|
||||||
-accel kvm
|
-accel kvm
|
||||||
-M q35
|
#-drive file.driver=virtio,file=hda.qcow2,index=0,media=disk
|
||||||
# usb
|
|
||||||
-device qemu-xhci
|
|
||||||
-cpu host
|
|
||||||
-m "2G,maxmem=$RAM"
|
-m "2G,maxmem=$RAM"
|
||||||
|
# virtio drivers
|
||||||
|
## disk
|
||||||
|
-blockdev driver=file,node-name=hda-file,filename=hda.qcow2
|
||||||
|
-blockdev driver=qcow2,node-name=hda,file=hda-file
|
||||||
|
-device virtio-blk-pci,drive=hda
|
||||||
|
## gpu
|
||||||
-vga virtio
|
-vga virtio
|
||||||
-drive if=virtio,file=hda.qcow2
|
## network
|
||||||
# shared memory
|
-netdev user,id=n0
|
||||||
-object memory-backend-ram,id=mem,size=2G,share=on
|
-device virtio-net-pci,netdev=n0
|
||||||
-numa node,memdev=mem
|
|
||||||
)
|
)
|
||||||
|
@ -2,11 +2,5 @@
|
|||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
. ./lib.sh
|
. ./lib.sh
|
||||||
|
|
||||||
CMD=(
|
"${CMD[@]}" \
|
||||||
"${CMD[@]}"
|
#-device usb-host,vendorid=vendor,productid=product
|
||||||
-nic user,model=virtio-net-pci
|
|
||||||
# usb passthrough, might need root privileges
|
|
||||||
-device usb-host,vendorid=0x058f,productid=0x6387
|
|
||||||
)
|
|
||||||
|
|
||||||
"${CMD[@]}"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user