mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Re-enable networking during Windows installation (#193)
* Force Windows VMs to use AHCI for the cdrom and hard disk devices. * Re-enable networking during Windows installation.
This commit is contained in:
		
							parent
							
								
									0a619985af
								
							
						
					
					
						commit
						87fea6c845
					
				
					 2 changed files with 34 additions and 20 deletions
				
			
		|  | @ -284,13 +284,6 @@ and [Windows 11](https://www.microsoft.com/en-gb/software-download/windows11) | ||||||
| along with the [VirtIO drivers for Windows](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/) | along with the [VirtIO drivers for Windows](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/) | ||||||
| and creates a virtual machine configuration. | and creates a virtual machine configuration. | ||||||
| 
 | 
 | ||||||
| **During the Windows install network interfaces are completely disabled!** This |  | ||||||
| is to allow those users who want to create local accounts to do so. A side affect |  | ||||||
| is that the first time **Windows boots with the QEMU network enabled it will blue |  | ||||||
| screen, automatically restart and then start normally with fully functioning |  | ||||||
| networking**. |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| ```bash | ```bash | ||||||
| quickget windows 11 | quickget windows 11 | ||||||
| quickemu --vm windows-11.conf | quickemu --vm windows-11.conf | ||||||
|  |  | ||||||
							
								
								
									
										39
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										39
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -813,11 +813,7 @@ function vm_boot() { | ||||||
|          -monitor none |          -monitor none | ||||||
|          -serial mon:stdio) |          -serial mon:stdio) | ||||||
| 
 | 
 | ||||||
|   # Disables network interface during Windows install. |   if [ -n "${bridge}" ]; then | ||||||
|   # See https://github.com/wimpysworld/quickemu/issues/115 |  | ||||||
|   if [ "${guest_os}" == "windows" ] && [ -n "${iso}" ]; then |  | ||||||
|     args+=(-nic none) |  | ||||||
|   elif [ -n "${bridge}" ]; then |  | ||||||
|     # Enable bridge mode networking |     # Enable bridge mode networking | ||||||
|     args+=(-nic bridge,br=${bridge},model=virtio-net-pci) |     args+=(-nic bridge,br=${bridge},model=virtio-net-pci) | ||||||
|   else |   else | ||||||
|  | @ -839,20 +835,38 @@ function vm_boot() { | ||||||
|     args+=(-drive if=floppy,format=raw,file="${floppy}") |     args+=(-drive if=floppy,format=raw,file="${floppy}") | ||||||
|   fi |   fi | ||||||
| 
 | 
 | ||||||
|  |   if [ "${guest_os}" == "windows" ]; then | ||||||
|  |     # shellcheck disable=SC2054 | ||||||
|  |     args+=(-device ahci,id=ahci) | ||||||
|  |   fi | ||||||
|  | 
 | ||||||
|   if [ -n "${iso}" ]; then |   if [ -n "${iso}" ]; then | ||||||
|  |     if [ "${guest_os}" == "windows" ]; then | ||||||
|  |       # shellcheck disable=SC2054 | ||||||
|  |       args+=(-drive id=iso,if=none,media=cdrom,file="${iso}" | ||||||
|  |             -device ide-cd,drive=iso,bus=ahci.1,bootindex=1) | ||||||
|  |     else | ||||||
|       # shellcheck disable=SC2054 |       # shellcheck disable=SC2054 | ||||||
|       args+=(-drive media=cdrom,index=0,file="${iso}") |       args+=(-drive media=cdrom,index=0,file="${iso}") | ||||||
|     fi |     fi | ||||||
|  |   fi | ||||||
| 
 | 
 | ||||||
|   if [ -n "${fixed_iso}" ]; then |   if [ -n "${fixed_iso}" ]; then | ||||||
|  |     if [ "${guest_os}" == "windows" ]; then | ||||||
|  |       # shellcheck disable=SC2054 | ||||||
|  |       args+=(-drive id=fixed_iso,if=none,media=cdrom,file="${fixed_iso}" | ||||||
|  |             -device ide-cd,drive=fixed_iso,bus=ahci.2) | ||||||
|  |     else | ||||||
|       # shellcheck disable=SC2054 |       # shellcheck disable=SC2054 | ||||||
|       args+=(-drive media=cdrom,index=1,file="${fixed_iso}") |       args+=(-drive media=cdrom,index=1,file="${fixed_iso}") | ||||||
|     fi |     fi | ||||||
|  |   fi | ||||||
| 
 | 
 | ||||||
|   # Attach the unattended configuration to Windows guests when booting from ISO |   # Attach the unattended configuration to Windows guests when booting from ISO | ||||||
|   if [ -n "${iso}" ] && [ "${guest_os}" == "windows" ] && [ -e "${VMDIR}/unattended.iso" ]; then |   if [ -n "${iso}" ] && [ "${guest_os}" == "windows" ] && [ -e "${VMDIR}/unattended.iso" ]; then | ||||||
|     # shellcheck disable=SC2054 |     # shellcheck disable=SC2054 | ||||||
|     args+=(-drive media=cdrom,index=2,file="${VMDIR}/unattended.iso") |     args+=(-drive id=unattended,if=none,media=cdrom,file="${VMDIR}/unattended.iso" | ||||||
|  |           -device ide-cd,drive=unattended,bus=ahci.3) | ||||||
|   fi |   fi | ||||||
| 
 | 
 | ||||||
|   if [ "${guest_os}" == "macos" ]; then |   if [ "${guest_os}" == "macos" ]; then | ||||||
|  | @ -870,11 +884,18 @@ function vm_boot() { | ||||||
|     # shellcheck disable=SC2054,SC2206 |     # shellcheck disable=SC2054,SC2206 | ||||||
|     args+=(-device ${MAC_DISK_DEV},drive=SystemDisk |     args+=(-device ${MAC_DISK_DEV},drive=SystemDisk | ||||||
|            -drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" ${STATUS_QUO}) |            -drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" ${STATUS_QUO}) | ||||||
|   else |   elif [ "${guest_os}" == "windows" ]; then | ||||||
|     # shellcheck disable=SC2054,SC2206 |     # shellcheck disable=SC2054,SC2206 | ||||||
|  |     args+=(-device ide-hd,drive=SystemDisk,bus=ahci.0,bootindex=0 | ||||||
|  |           -drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" ${STATUS_QUO}) | ||||||
|  |   else | ||||||
|     args+=(-device virtio-blk-pci,drive=SystemDisk |     args+=(-device virtio-blk-pci,drive=SystemDisk | ||||||
|            -drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" ${STATUS_QUO} |            -drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" ${STATUS_QUO}) | ||||||
|            -device ${USB_HOST_PASSTHROUGH_CONTROLLER},id=spicepass |   fi | ||||||
|  | 
 | ||||||
|  |   if [ "${guest_os}" != "macos" ]; then | ||||||
|  |     # shellcheck disable=SC2054,SC2206 | ||||||
|  |     args+=(-device ${USB_HOST_PASSTHROUGH_CONTROLLER},id=spicepass | ||||||
|            -chardev spicevmc,id=usbredirchardev1,name=usbredir |            -chardev spicevmc,id=usbredirchardev1,name=usbredir | ||||||
|            -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 |            -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 | ||||||
|            -chardev spicevmc,id=usbredirchardev2,name=usbredir |            -chardev spicevmc,id=usbredirchardev2,name=usbredir | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue