Print qemu command

This commit is contained in:
2026-08-29 21:04:27 +02:00
parent 56a76ce934
commit 41bc570bfb
2 changed files with 9 additions and 2 deletions
+2
View File
@@ -2,6 +2,8 @@ FROM alpine:latest
RUN mkdir -p /lib/apk/db /run RUN mkdir -p /lib/apk/db /run
RUN apk add --no-cache --initdb linux-virt busybox util-linux RUN apk add --no-cache --initdb linux-virt busybox util-linux
RUN cp /boot/vmlinuz-virt /vmlinuz && echo "Welcome to slim!" > /etc/motd RUN cp /boot/vmlinuz-virt /vmlinuz && echo "Welcome to slim!" > /etc/motd
# Use custom init script
COPY init /init COPY init /init
RUN chmod +x /init RUN chmod +x /init
+7 -2
View File
@@ -33,7 +33,8 @@ pub(crate) fn run(name: &str) -> Result<()> {
] ]
.join(" "); .join(" ");
let status = Command::new("qemu-system-x86_64") let mut command = Command::new("qemu-system-x86_64");
command
.args(["-m", "1024M"]) .args(["-m", "1024M"])
.arg("-kernel") .arg("-kernel")
.arg(vmlinuz_path.as_os_str()) .arg(vmlinuz_path.as_os_str())
@@ -41,7 +42,11 @@ pub(crate) fn run(name: &str) -> Result<()> {
.arg(initrd_path.as_os_str()) .arg(initrd_path.as_os_str())
.args(["-append", &cmdline]) .args(["-append", &cmdline])
.args(["-nographic"]) .args(["-nographic"])
.args(["-nic", "user,model=virtio-net-pci"]) .args(["-nic", "user,model=virtio-net-pci"]);
println!("{command:?}");
let status = command
.status() .status()
.context("Failed to launch qemu-system-x86_64")?; .context("Failed to launch qemu-system-x86_64")?;