]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Adds support fo run live systems
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 19 Jun 2018 21:43:42 +0000 (18:43 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 19 Jun 2018 21:43:42 +0000 (18:43 -0300)
kvmx
kvmxfile

diff --git a/kvmx b/kvmx
index 2ea0a3075b00e4673023805f8ff893d1b4f38f37..ae1a7cd143ce8fc030acb69ea031c4dd0fb3299a 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -443,27 +443,35 @@ function kvmx_up {
     sound_opts="-soundhw $sound"
   fi
 
+  if [ ! -z "$image_drive" ] && [ "$image_drive" == "cdrom" ]; then
+    image_opts="-cdrom $image"
+  else
+    image_opts="-drive file=$image,if=$drive_interface"
+  fi
+
   # Run virtual machine, nohup approach
   # See https://en.wikipedia.org/wiki/Nohup#Overcoming_hanging
   #nohup kvm -m $memory -name $VM                                                                    \
-  #  -drive    file=$image,if=$drive_interface $graphics $shared                                     \
   #  -chardev "socket,id=monitor,path=$MONITORFILE,server,nowait" -mon chardev=monitor,mode=readline \
   #  -chardev "socket,id=serial0,path=$CONSOLEFILE,server,nowait" -device isa-serial,chardev=serial0 \
   #  -smp $smp -cpu host -balloon virtio                                                             \
+  #  $graphics $shared                                                                               \
+  #  $image_opts                                                                                     \
+  #  $spice_opts                                                                                     \
   #  $sound_opts                                                                                     \
   #  $cdrom_opts                                                                                     \
   #  $boot_opts                                                                                      \
-  #  $spice_opts                                                                                     \
   #  $net_opts                                                                                       \
   #  $qemu_opts &> $LOGFILE < /dev/null &
 
   # Run virtual machine, screen approach
   # This is more immune to hangups
   screen -S kvmx-qemu-$VM -d -m kvm -m $memory -name $VM                                            \
-    -drive    file=$image,if=$drive_interface $graphics $shared                                     \
     -chardev "socket,id=monitor,path=$MONITORFILE,server,nowait" -mon chardev=monitor,mode=readline \
     -chardev "socket,id=serial0,path=$CONSOLEFILE,server,nowait" -device isa-serial,chardev=serial0 \
     -smp $smp -cpu host -balloon virtio                                                             \
+    $graphics $shared                                                                               \
+    $image_opts                                                                                     \
     $spice_opts                                                                                     \
     $sound_opts                                                                                     \
     $cdrom_opts                                                                                     \
index a3983678acba66b0590eb463a49a67a19c48ca9c..660132d00e1c8ac65ca486af4f9303f5502907d6 100644 (file)
--- a/kvmxfile
+++ b/kvmxfile
@@ -117,6 +117,9 @@ xrandr="0"
 # Where datafiles are stored: just set this if you know what you're doing
 #datadir="$HOME/.local/share/kvmx/$VM"
 
+# Drive type: use this if you want to run a Live CD/DVD/USB
+#image_drive="cdrom"
+
 # Image type: file or device (kvmx-create only)
 image_type="file"