mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Export $HOME from the host to the guest VM is smbd is available
This commit is contained in:
		
							parent
							
								
									bc322f280c
								
							
						
					
					
						commit
						b2c44fe879
					
				
					 1 changed files with 15 additions and 11 deletions
				
			
		
							
								
								
									
										26
									
								
								quickemu.sh
									
										
									
									
									
								
							
							
						
						
									
										26
									
								
								quickemu.sh
									
										
									
									
									
								
							|  | @ -69,6 +69,21 @@ function vm_boot() { | |||
|     iso="" | ||||
|   fi | ||||
| 
 | ||||
|   # If smbd is available, export $HOME to the guest via samba | ||||
|   if [ "${ENGINE}" == "virgil" ] && [ -e /snap/qemu-virgil/current/usr/sbin/smbd ]; then | ||||
|       SAMBA=",smb=${HOME}" | ||||
|   elif [ "${ENGINE}" == "system-x86_64" ] && [ -e /usr/sbin/smbd ]; then | ||||
|       SAMBA=",smb=${HOME}" | ||||
|   else | ||||
|       SAMBA="" | ||||
|   fi | ||||
| 
 | ||||
|   if [ -n "${SAMBA}" ]; then | ||||
|     echo "NOTE! ${HOME} will be available on the guest via smb://10.0.2.4/qemu" | ||||
|   else | ||||
|     echo "NOTE! %{HOME} will not be available in the guest. 'smbd' not found." | ||||
|   fi | ||||
| 
 | ||||
|   # Boot the iso image | ||||
|   qemu-${ENGINE} \ | ||||
|     -cdrom "${iso}" \ | ||||
|  | @ -101,7 +116,6 @@ function usage() { | |||
|   echo "  --efi      : Enable EFI BIOS (default)." | ||||
|   echo "  --legacy   : Enable legacy BIOS." | ||||
|   echo "  --restore  : Restore the snapshot." | ||||
|   echo "  --samba    : Share your home directory to the guest." | ||||
|   echo "  --snapshot : Create a disk snapshot." | ||||
|   echo "  --virgil   : Use virgil, if available." | ||||
|   exit 1 | ||||
|  | @ -111,7 +125,6 @@ BIOS="-bios /usr/share/qemu/OVMF.fd" | |||
| DELETE=0 | ||||
| ENGINE="system-x86_64" | ||||
| RESTORE=0 | ||||
| SAMBA="" | ||||
| SNAPSHOT=0 | ||||
| VM="" | ||||
| 
 | ||||
|  | @ -129,15 +142,6 @@ while [ $# -gt 0 ]; do | |||
|     -restore|--restore) | ||||
|       RESTORE=1 | ||||
|       shift;; | ||||
|     -samba|--samba) | ||||
|       TEST_SMBD=$(which smbd) | ||||
|       if [ $? -eq 0 ]; then | ||||
|         SAMBA=",smb=${HOME}" | ||||
|         echo "NOTE! ${HOME} will be available on the guest via smb://10.0.2.4/qemu" | ||||
|       else | ||||
|         echo "WARNING! Requested sharing %{HOME} via samba. 'smbd' not found." | ||||
|       fi | ||||
|       shift;; | ||||
|     -snapshot|--snapshot) | ||||
|       SNAPSHOT=1 | ||||
|       shift;; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue