Skip to content

Commit

Permalink
vm.fedora: update
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-fg committed Aug 10, 2018
1 parent 7e751fe commit d360d8b
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions vm/fedora
Expand Up @@ -11,6 +11,19 @@ vde_path=~/tmp/vde
dump_inc=
restore=
net_only=
img=install
video=( -nographic )
fs=

[[ "$1" = -i || "$1" = --img ]] && { img="$2"; shift; shift; }
[[ "$1" = -f || "$1" = --fs ]] && { fs=t; shift; }

[[ "$1" = -g || "$1" = --graphic ]] && {
video=( -vga std )
# video+=( -display gtk )
# video+=( -display vnc 0 )
shift
}

case "$1" in
d|dump)
Expand Down Expand Up @@ -51,7 +64,16 @@ EOF

'') ;;
*)
echo >&2 "Usage: $0 [ { d | dump } [path] | { r | restore } [-i] [path] | { m | monitor } | { n | net-only } ]"
echo >&2 "Usage: $0 [ {-i|--img} basename] [-g|--graphic] [-f|--fs] \\"
echo >&2 " [ { d | dump } [path] | { r | restore } [-i] [path] | { m | monitor } | { n | net-only } ]"
cat >&2 <<EOF
Cheatsheet for qemu-img:
qemu-img create -f qcow2 install.qcow2 10G
qemu-img create -b install.qcow2 -f qcow2 install.qcow2.inc
qemu-img commit install.qcow2.inc && rm install.qcow2.inc
EOF
exit 1 ;;
esac

Expand Down Expand Up @@ -99,20 +121,23 @@ done
qemu_opts=(
-name "$(basename "$0")"

-m 512
-m 4096M
-rtc base=utc,clock=host
-monitor telnet:127.0.0.1:${telnet_port},server,nowait
-usb -device usb-kbd -device usb-mouse
-net nic,macaddr=${vde_mac},name=vde
-net vde,sock="$vde_path"/link.sock
-k en-us

-enable-kvm
-cpu host
-smp 2
-vga std
"${video[@]}"
"${fs_opts[@]}"

-cdrom fedora/Fedora-Live-Workstation-i686-21-5.iso
-drive file=fedora/install_inc.qcow2,if=virtio,aio=native,cache=writeback
-drive file=fedora/"$img".qcow2.inc,if=virtio,aio=native,cache=writeback,cache.direct=on
# -cdrom fedora/Fedora-Workstation-Live-x86_64-28-1.1.iso
# -drive id=disk,file=fedora/"$img".qcow2.inc,if=none -device ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0
)

ulimit -c 0
Expand Down

0 comments on commit d360d8b

Please sign in to comment.