diff options
Diffstat (limited to 'emacs.org')
-rwxr-xr-x | emacs.org | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -330,17 +330,24 @@ Fonts and basic appearance settings for each device #+end_src * VM Manager #+begin_src emacs-lisp + (defvar vm-directory "~/VirtualMachines/") + (defun vm-create-image () - (let ((name (format "%s.qcow2" (read-string "Name: "))) + "Create qcow2 image." + (interactive) + (let ((name (format "%s%s.qcow2" vm-directory (read-string "Name: "))) (size (format "%s" (read-string "Size(G): ")))) (shell-command (format "qemu-img create -f qcow2 %s %sG" name size)))) + (defun vm-run () + "Spawn Virtual Machine." + (interactive) (let ((memory (format "%sG" (read-string "Memory(G): "))) (cores (read-string "Cores: ")) - (image (read-file-name "Image: ")) - (iso (if (y-or-n-p "Load iso? ") + (image (read-file-name "Image: " vm-directory)) + (iso (if (y-or-n-p "Load iso?? ") (read-file-name "ISO: ") nil))) (async-shell-command |