mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Allow persist MAC addresses for bridged interfaces. Fixes #287
This commit is contained in:
		
							parent
							
								
									8bb24f69c0
								
							
						
					
					
						commit
						2e15b1219f
					
				
					 3 changed files with 30 additions and 4 deletions
				
			
		
							
								
								
									
										10
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								README.md
									
										
									
									
									
								
							|  | @ -631,10 +631,18 @@ additional line to your virtual machine configuration: | ||||||
| # Bridged networking | # Bridged networking | ||||||
| 
 | 
 | ||||||
| Connect your virtual machine to a preconfigured network bridge. Add an | Connect your virtual machine to a preconfigured network bridge. Add an | ||||||
| additional line to your virtual machine configuration | additional line to your virtual machine configuration: | ||||||
| 
 | 
 | ||||||
| -   `network="br0"` | -   `network="br0"` | ||||||
| 
 | 
 | ||||||
|  | If you want to have a persistent MAC address for your bridged network interface | ||||||
|  | in the gust VM you can add `macaddr` to the virtual machine configuration. QEMU | ||||||
|  | requires that the MAC address is in the range: **52:54:00:AB:00:00 - 52:54:00:AB:FF:FF** | ||||||
|  | 
 | ||||||
|  | So you can generate your own MAC addresses with: | ||||||
|  | 
 | ||||||
|  | -   `macaddr="52:54:00:AB:51:AE"` | ||||||
|  | 
 | ||||||
| # USB redirection | # USB redirection | ||||||
| 
 | 
 | ||||||
| Quickemu supports USB redirection via SPICE pass-through and host | Quickemu supports USB redirection via SPICE pass-through and host | ||||||
|  |  | ||||||
|  | @ -26,7 +26,6 @@ These are the options and defaults for the \<vm\>.conf file | ||||||
| ``` bash | ``` bash | ||||||
| # Lowercase variables are used in the VM config file only | # Lowercase variables are used in the VM config file only | ||||||
| boot="efi" | boot="efi" | ||||||
| bridge="" |  | ||||||
| cpu_cores="" | cpu_cores="" | ||||||
| disk_img="" | disk_img="" | ||||||
| disk_size="" | disk_size="" | ||||||
|  | @ -35,7 +34,9 @@ floppy="" | ||||||
| guest_os="linux" | guest_os="linux" | ||||||
| img="" | img="" | ||||||
| iso="" | iso="" | ||||||
|  | macaddr="" | ||||||
| macos_release="" | macos_release="" | ||||||
|  | network="" | ||||||
| port_forwards=() | port_forwards=() | ||||||
| preallocation="off" | preallocation="off" | ||||||
| ram="" | ram="" | ||||||
|  | @ -77,6 +78,7 @@ disk_img="windows-11/disk.qcow2" | ||||||
| iso="windows-11/Win11_EnglishInternational_x64.iso" | iso="windows-11/Win11_EnglishInternational_x64.iso" | ||||||
| fixed_iso="windows-11/virtio-win.iso" | fixed_iso="windows-11/virtio-win.iso" | ||||||
| tpm="on" | tpm="on" | ||||||
|  | secureboot="on" | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| -   `guest_os="windows"` instructs `quickemu` to optimise for Windows. | -   `guest_os="windows"` instructs `quickemu` to optimise for Windows. | ||||||
|  | @ -202,10 +204,18 @@ additional line to your virtual machine configuration: | ||||||
| # Bridged networking | # Bridged networking | ||||||
| 
 | 
 | ||||||
| Connect your virtual machine to a preconfigured network bridge. Add an | Connect your virtual machine to a preconfigured network bridge. Add an | ||||||
| additional line to your virtual machine configuration | additional line to your virtual machine configuration: | ||||||
| 
 | 
 | ||||||
| -   `network="br0"` | -   `network="br0"` | ||||||
| 
 | 
 | ||||||
|  | If you want to have a persistent MAC address for your bridged network interface | ||||||
|  | in the gust VM you can add `macaddr` to the virtual machine configuration. QEMU | ||||||
|  | requires that the MAC address is in the range: **52:54:00:AB:00:00 - 52:54:00:AB:FF:FF** | ||||||
|  | 
 | ||||||
|  | So you can generate your own MAC addresses with: | ||||||
|  | 
 | ||||||
|  | -   `macaddr="52:54:00:AB:51:AE"` | ||||||
|  | 
 | ||||||
| # USB redirection | # USB redirection | ||||||
| 
 | 
 | ||||||
| Quickemu supports USB redirection via SPICE pass-through and host | Quickemu supports USB redirection via SPICE pass-through and host | ||||||
|  |  | ||||||
							
								
								
									
										10
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -1008,8 +1008,15 @@ function vm_boot() { | ||||||
|   elif [ -n "${network}" ]; then |   elif [ -n "${network}" ]; then | ||||||
|     # Enable bridge mode networking |     # Enable bridge mode networking | ||||||
|     echo " - Network:  Bridged (${network})" |     echo " - Network:  Bridged (${network})" | ||||||
|  | 
 | ||||||
|  |     # If a persistent MAC address is provided, use it. | ||||||
|  |     local MAC="" | ||||||
|  |     if [ -n "${macaddr}" ]; then | ||||||
|  |       MAC=",mac=${macaddr}" | ||||||
|  |     fi | ||||||
|  | 
 | ||||||
|     # shellcheck disable=SC2054,SC2206 |     # shellcheck disable=SC2054,SC2206 | ||||||
|     args+=(-nic bridge,br=${network},model=virtio-net-pci) |     args+=(-nic bridge,br=${network},model=virtio-net-pci${MAC}) | ||||||
|   else |   else | ||||||
|     echo " - Network:  User (${NET_DEVICE})" |     echo " - Network:  User (${NET_DEVICE})" | ||||||
|     # shellcheck disable=SC2054,SC2206 |     # shellcheck disable=SC2054,SC2206 | ||||||
|  | @ -1418,6 +1425,7 @@ floppy="" | ||||||
| guest_os="linux" | guest_os="linux" | ||||||
| img="" | img="" | ||||||
| iso="" | iso="" | ||||||
|  | macaddr="" | ||||||
| macos_release="" | macos_release="" | ||||||
| network="" | network="" | ||||||
| port_forwards=() | port_forwards=() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue