<# .SYNOPSIS Launch QEMU with appropriate command line parameters for PureOS Librem5 image. .DESCRIPTION The script builds the commandline parameters and then calls the x86_64 version of QEMU to execute the raw image downloaded from the project website: [[https://arm01.puri.sm/job/Images/job/Image%20Build/changes][Latest Build]] This PowerShell script implements the following example qemu call: C:\Program Files\qemu\qemu-system-x86_64.exe -drive file=c:\downloads\qemu-x86_64.img,index=0,media=disk,format=raw -vga virtio -display sdl,gl=off -m 2G -L Bios -boot menu=on -rtc base=localtime,clock=host -parallel none -serial none -name PureOS -no-reboot .POWERSHELL_EXAMPLE .\Launch-Librem5.ps1 #> ### You MUST edit the following lines for the paths on your system # Full path the QEMU executable, x86-64 mode. $pathToQemuExecutable = "C:\Program Files\qemu\qemu-system-x86_64.exe" # Full path to the downloaded raw image from the project. $ImageFilePath = "D:\VirtualBoxFiles\librem5_build143.img" ### The remaining lines MAY be changed, but they work as defined # Name displayed on the title bar of QEMU when run in windowed mode. $vmDisplayName = "Librem5_Build_143" #The zero based index for the drive image (0 = Boot). $diskImageIndex = "0" #Currently, the project is building raw images instead of Virtual Machine VDI/VHD types. $diskImageFormat = "raw" #The image provided is a virtual hard drive or 'disk' image. $diskMediaType = "disk" # Basic/working settings for getting the display to show on my machine. $vmVideoModes = "-vga virtio -display sdl,gl=off" # Memory size in Gigabytes for the virtual machine. $vmMemorySize = "4G" # Boot loader type $vmBootLoaderType = "BIOS" # Parallel devices are not used at this time. $vmParallelDevices = "none" # Serial devices are not used at this time. $vmSerialDevices = "none" #Use the real-time-clock (RTC) values from the host. $vmClockSettings = "-rtc base=localtime,clock=host" #Display the ipxe boot menu at the start. $vmBootMenuOnOff = "off" #Miscellaneous parameters for task specific needs. This list can be empty. $miscParameters = "-no-reboot" # # Map script variables to command line arguments using an Array of Strings # $argumentsList = @("-drive" "file=$ImageFilePath,index=$diskImageIndex,media=$diskMediaType,format=$diskImageFormat" "$vmVideoModes" "-m $vmMemorySize" "-L $vmBootLoaderType" "-boot menu=$vmBootMenuOnOff" "$vmClockSettings" "-parallel $vmParallelDevices" "-serial $vmSerialDevices" "-name $vmDisplayName" "$miscParameters") # Convert all of the items in $argumentsList to a space delimited string for command line parameters $arguments = @($argumentsList | % {"$_"}) Write-Host $arguments # Execute the command with parameters Start-Process $pathToQemuExecutable -ArgumentList $arguments