[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
howtos:emulators:helper_script_for_managing_qemu_virtual_machines [2016/09/01 09:14 (UTC)] – [Using Qemu from Unprivileged Users] louigi600howtos:emulators:helper_script_for_managing_qemu_virtual_machines [2016/09/02 08:04 (UTC)] – [Sources] louigi600
Line 388: Line 388:
  
   User_Alias QEMUERS = al, john, jack   User_Alias QEMUERS = al, john, jack
 +  
   Cmnd_Alias QEMUCMD = /usr/bin/qemu-system-*   Cmnd_Alias QEMUCMD = /usr/bin/qemu-system-*
      
   QEMUERS ALL=(ALL) NOPASSWD: QEMU   QEMUERS ALL=(ALL) NOPASSWD: QEMU
  
-This would be sufficient to run the VMs as any of the unprivileged users in QEMUERS user alias (al, john, jack).+This would be sufficient to run the VMs as any of the unprivileged users in QEMUERS user alias (al, john, jack) but the management script would need to run sudo qemu-system-* .... this is easy to obtain: 
 + 
 +  [ $(/usr/bin/id -u) -ne 0 ] && CMD="sudo qemu-system-.... " || CMD="qemu-system-...." 
 +  eval $(echo "$CMD &"
 + 
 +Alternatively you could give privileges to execute the management script as root.
 ===== Examples ===== ===== Examples =====
 Here are examples of the dialogs that user would see wile creating, starting, stopping and deleting a VM. Here are examples of the dialogs that user would see wile creating, starting, stopping and deleting a VM.
Line 612: Line 617:
  
 ====== Sources ====== ====== Sources ======
 +I've a blog entry on LQ where I talk a little more extensively on minimizing the code in bash scripts.
 +[[http://www.linuxquestions.org/questions/blog/louigi600-808242/minimize-the-amount-of-code-in-your-bash-scripts-37137/|Minimize the amount of code in your bash scripts ]]
  
 <!-- If you are copying information from another source, then specify that source --> <!-- If you are copying information from another source, then specify that source -->
 howtos:emulators:helper_script_for_managing_qemu_virtual_machines ()