mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Detect insufficient RAM for Windows and macOS Close #78
Also changes the RAM allocation for the VM to better attempt a working configuration.
This commit is contained in:
		
							parent
							
								
									247b3d8a4e
								
							
						
					
					
						commit
						d1afc10857
					
				
					 1 changed files with 12 additions and 7 deletions
				
			
		
							
								
								
									
										19
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										19
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -297,22 +297,27 @@ function vm_boot() { | |||
|       RAM_HOST=$(free --mega -h | grep Mem | cut -d':' -f2 | cut -d'G' -f1 | sed 's/ //g') | ||||
|       #Round up - https://github.com/wimpysworld/quickemu/issues/11 | ||||
|       RAM_HOST=$(printf '%.*f\n' 0 "${RAM_HOST}") | ||||
|       if [ "${RAM_HOST}" -ge 256 ]; then | ||||
|       if [ "${RAM_HOST}" -ge 128 ]; then | ||||
|         RAM_VM="32G" | ||||
|       elif [ "${RAM_HOST}" -ge 128 ]; then | ||||
|         RAM_VM="16G" | ||||
|       elif [ "${RAM_HOST}" -ge 64 ]; then | ||||
|         RAM_VM="8G" | ||||
|       elif [ "${RAM_HOST}" -ge 32 ]; then | ||||
|         RAM_VM="4G" | ||||
|         RAM_VM="16G" | ||||
|       elif [ "${RAM_HOST}" -ge 16 ]; then | ||||
|         RAM_VM="3G" | ||||
|         RAM_VM="8G" | ||||
|       elif [ "${RAM_HOST}" -ge 8 ]; then | ||||
|         RAM_VM="4G" | ||||
|       fi | ||||
|   else | ||||
|       RAM_VM="${ram}" | ||||
|   fi | ||||
|   echo ", ${RAM_VM} RAM" | ||||
| 
 | ||||
|   if [ ${RAM_VM//G/} -lt 4 ]; then | ||||
|     if [ "${guest_os}" == "macos" ] || [ "${guest_os}" == "windows" ]; then | ||||
|         echo "ERROR! You have insufficient RAM to run ${guest_os} in a VM" | ||||
|         exit 1 | ||||
|     fi | ||||
|   fi | ||||
| 
 | ||||
|   # Make any OS specific adjustments | ||||
|   case ${guest_os} in | ||||
|     freebsd|linux) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue