-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·32 lines (26 loc) · 842 Bytes
/
run.sh
File metadata and controls
executable file
·32 lines (26 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
readonly KERN_CMDLINE="fips=0"
readonly KERNIMG=bzImage
readonly ROOTFS=bookworm.img
if [ ! -f "${KERNIMG}" ]; then
echo "error: missing kernel image, e.g., bzImage"
exit 1
fi
if [ ! -f "${ROOTFS}" ]; then
echo "error: missing virtual disk"
exit 1
fi
qemu-system-x86_64 \
--enable-kvm \
-cpu host \
-smp 4,sockets=1,cores=4,threads=1 \
-m 4G \
-kernel "${KERNIMG}" \
-drive file="${ROOTFS}",format=raw \
-append "root=/dev/sda rw console=ttyS0 trace_clock=local nokaslr ${KERN_CMDLINE}" \
-netdev user,host=10.0.2.10,id=mynet0,hostfwd=tcp::10022-:22 \
-device virtio-net-pci,netdev=mynet0 \
-virtfs local,path=shared,mount_tag=shared,security_model=mapped-xattr \
--nographic \
-pidfile vm.pid
# NOTE: to setup ad debugger add the '-s -S' in the command line above.