Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--script-exec and --script-sh don't seem to work #6

Closed
zevweiss opened this issue Sep 26, 2016 · 1 comment
Closed

--script-exec and --script-sh don't seem to work #6

zevweiss opened this issue Sep 26, 2016 · 1 comment

Comments

@zevweiss
Copy link
Contributor

I can't seem to get any output with virtme-run's --script-exec or --script-sh flags. Without them I get kernel console message in my terminal as expected, but whenever I use either of these flags I get no output from either the guest kernel or my script -- or even any evidence that my script runs at all, actually. I put an infinite loop in a bash script (while :; do :; done) and passed it to --script-exec, hoping to see qemu continue to peg the CPU beyond a normal guest-boot duration, but its CPU consumption quieted down after about the same amount of time it does when booting into an interactive shell, so it seems like the script isn't getting executed.

I've tried both the cat | prefix mentioned in the --help output and < /dev/null to redirect stdin, but haven't seen any difference in behavior either way. (Using the --force-initramfs flag also hasn't made any difference, if it's relevant.)

Running with --show-command prints:

/usr/local/qemu-2.7.0/bin/qemu-system-x86_64 -fsdev local,id=virtfs1,path=/,security_model=none,readonly -device virtio-9p-pci,fsdev=virtfs1,mount_tag=/dev/root -fsdev local,id=virtfs5,path=/home/zev/src/virtme/virtme/guest,security_model=none,readonly -device virtio-9p-pci,fsdev=virtfs5,mount_tag=virtme.guesttools -fsdev local,id=virtfs9,path=/lib/modules/4.7.0-bcfs-nopreempt+,security_model=none,readonly -device virtio-9p-pci,fsdev=virtfs9,mount_tag=virtme.moddir -machine accel=kvm:tcg -watchdog i6300esb -cpu host -parallel none -net none -vga none -display none -serial none -chardev file,id=console,path=/proc/self/fd/2 -serial chardev:console -chardev stdio,id=stdio,signal=on,mux=off -device virtio-serial-pci -device virtserialport,name=virtme.scriptio,chardev=stdio -no-reboot -kernel /boot/vmlinuz-4.7.0-bcfs-nopreempt+ -append 'virtme_chdir=home/zev init=/bin/sh -- -c "mount -t tmpfs run /run;mkdir -p /run/virtme/guesttools;/bin/mount -n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any virtme.guesttools /run/virtme/guesttools;exec /run/virtme/guesttools/virtme-init"' -initrd /proc/self/fd/4

and the contents of /home/zev/test-script.sh are:

#!/bin/bash
while :; do :; done

This is with python 3.5.0 and qemu 2.7.0, on a 4.7.0 kernel.

@zevweiss
Copy link
Contributor Author

Fixed by pull request #7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant