mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Enable arbitrary port forwarding via config file (#40)
* Add the possibility to forward ports from host to guest * Reorganized code, fixed a bug, updated the README * Updated the README * Forgot to remove 'exit' ....
This commit is contained in:
		
							parent
							
								
									76670511dd
								
							
						
					
					
						commit
						63f5c11a8e
					
				
					 2 changed files with 23 additions and 0 deletions
				
			
		
							
								
								
									
										11
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -370,6 +370,17 @@ function vm_boot() { | |||
|     echo " - ssh:      All ports for exposing ssh have been exhausted." | ||||
|   fi | ||||
| 
 | ||||
|   # Have any port forwards been requested? | ||||
|   if (( ${#port_forwards[@]} )); then | ||||
|     echo " - PORTS:    Port forwards requested:" | ||||
|     for FORWARD in "${port_forwards[@]}"; do | ||||
|       HOST_PORT=$(echo ${FORWARD} | cut -d':' -f1) | ||||
|       GUEST_PORT=$(echo ${FORWARD} | cut -d':' -f2) | ||||
|       echo "              - ${HOST_PORT} => ${GUEST_PORT}" | ||||
|       NET="${NET},hostfwd=tcp::${HOST_PORT}-:${GUEST_PORT}" | ||||
|     done | ||||
|   fi | ||||
| 
 | ||||
|   # Find a free port for spice | ||||
|   local SPICE_PORT=$(get_port 5930 9) | ||||
|   if [ ! -n "${SPICE_PORT}" ]; then | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue