Created
January 26, 2018 08:28
-
-
Save alex-pat/6e4aedf94eab926a74bd3b9c4074e1d4 to your computer and use it in GitHub Desktop.
Run qemu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qstrt() { | |
if [ "$1" == "help" ]; then | |
echo 'qstrt <kernel> <image> [gui [nokvm]]' | |
return | |
fi | |
local _QEMGUI="-nographic" | |
local _QEMCON="console=ttyS0" | |
local _QEMKVM="-enable-kvm" | |
if [ "$3" == "gui" ]; then | |
_QEMGUI="" | |
_QEMCON="" | |
fi | |
test "$4" == "nokvm" && _QEMKVM="" | |
xhost + >/dev/null | |
sudo qemu-system-x86_64 -kernel "$1" \ | |
-drive file="$2",index=0,media=disk,format=raw \ | |
-append "root=/dev/sda single $_QEMCON" \ | |
$_QEMKVM $_QEMGUI | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment