diff --git a/.gitignore b/.gitignore index 5791d2b..af5040b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,10 +5,7 @@ !/README.md !/CHANGELOG.md !/run.sh -!/run.ps1 !/get-iso.sh -!/get-iso.ps1 -!/add-ssh-key.ps1 !/scripts/ !/share/ !/.claude/ diff --git a/README.md b/README.md index 4d3d73a..05bde60 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,6 @@ tracked file to it explicitly. - `curl` and `sha256sum` for `get-iso.sh`. - Optional: an NVIDIA dGPU for `--nvidia` (PRIME offload of the virgl renderer). -### Windows - -`run.ps1` and `get-iso.ps1` are Windows versions. They need -[QEMU for Windows](https://qemu.weilnetz.de/w64/) (or set `QEMU_DIR`) and the -"Windows Hypervisor Platform" feature (`-accel whpx`). Windows QEMU has no 9p -shares: copy the repo into the guest with `scp -P 2222 -r ...`, and authorize -your key with `.\add-ssh-key.ps1 -User `. - ## Quick start ```bash @@ -77,8 +69,7 @@ user's password: ssh-copy-id -p 2222 @localhost ``` -On Windows, use `.\add-ssh-key.ps1 -User ` instead (it creates a key -if needed). If SSH hangs at "banner exchange", `sshd` isn't running in the +If SSH hangs at "banner exchange", `sshd` isn't running in the guest or a firewall blocks port 22; check with `systemctl is-active sshd` in the guest. diff --git a/add-ssh-key.ps1 b/add-ssh-key.ps1 deleted file mode 100644 index aaeb0a1..0000000 --- a/add-ssh-key.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -# Windows: authorize your SSH key in the VM (asks for the VM password once). -# Run after guest-ssh-setup.sh inside the VM, or at least after sshd is enabled there. -# .\add-ssh-key.ps1 -User -param([Parameter(Mandatory)][string]$User) -$ErrorActionPreference = 'Stop' -$key = Join-Path $env:USERPROFILE '.ssh\id_ed25519.pub' -if (-not (Test-Path $key)) { ssh-keygen -t ed25519 -f ($key -replace '\.pub$', '') -N '""' } -Get-Content $key | ssh -p 2222 "$User@localhost" 'install -d -m 700 ~/.ssh && k=$(cat) && (grep -qxF "$k" ~/.ssh/authorized_keys 2>/dev/null || echo "$k" >> ~/.ssh/authorized_keys) && chmod 600 ~/.ssh/authorized_keys' -Write-Host "Done. Connect with: ssh -p 2222 $User@localhost" diff --git a/get-iso.ps1 b/get-iso.ps1 deleted file mode 100644 index cdb015e..0000000 --- a/get-iso.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -# Download the latest CachyOS desktop ISO to cachyos.iso and verify its checksum. -# Windows version of get-iso.sh; re-running resumes a partial download. -$ErrorActionPreference = 'Stop' -Set-Location $PSScriptRoot - -$mirror = if ($env:MIRROR) { $env:MIRROR } else { 'https://nl.mirror.cx/cachyos' } - -$page = (Invoke-WebRequest -UseBasicParsing https://cachyos.org/download/).Content -$m = [regex]::Match($page, 'ISO/desktop/[0-9]+/cachyos-desktop-linux-[0-9]+\.iso') -if (-not $m.Success) { throw 'Could not find the current ISO on cachyos.org/download' } -$url = "$mirror/$($m.Value)" -$name = Split-Path $m.Value -Leaf -Write-Host "Latest release: $name" - -if ((Test-Path cachyos.iso) -and ((Get-Content cachyos.iso.version -ErrorAction SilentlyContinue) -ne $name)) { - Write-Host 'Existing cachyos.iso is an older release, replacing it.' - Remove-Item cachyos.iso -} - -# curl.exe ships with Windows 10+ and supports resuming (-C -). -curl.exe -fL -C - -o cachyos.iso $url -if ($LASTEXITCODE -ne 0) { throw 'Download failed' } -Set-Content cachyos.iso.version $name - -Write-Host 'Verifying checksum...' -$expected = ((curl.exe -fsL "$url.sha256") -split '\s+')[0] -$actual = (Get-FileHash cachyos.iso -Algorithm SHA256).Hash -if ($actual -ieq $expected) { Write-Host 'cachyos.iso: OK' } else { throw "Checksum mismatch: $actual" } diff --git a/run.ps1 b/run.ps1 deleted file mode 100644 index 642a212..0000000 --- a/run.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -# CachyOS test VM for steamify.sh -- Windows version. -# .\run.ps1 [-Install] -# Needs QEMU for Windows (https://qemu.weilnetz.de/w64/) and the Windows -# feature "Windows Hypervisor Platform" (for -accel whpx). -# Windows QEMU has no 9p shared folders: copy the repo in over SSH instead: -# scp -P 2222 -r ..\..\projects\cachyos-gamescope-boot @localhost: -param([switch]$Install) -$ErrorActionPreference = 'Stop' -Set-Location $PSScriptRoot - -$qemuDir = if ($env:QEMU_DIR) { $env:QEMU_DIR } else { 'C:\Program Files\qemu' } -$qemu = Join-Path $qemuDir 'qemu-system-x86_64.exe' -$code = Join-Path $qemuDir 'share\edk2-x86_64-code.fd' - -if (-not (Test-Path vars.fd)) { Copy-Item (Join-Path $qemuDir 'share\edk2-i386-vars.fd') vars.fd } -if (-not (Test-Path disk.qcow2)) { & (Join-Path $qemuDir 'qemu-img.exe') create -f qcow2 disk.qcow2 60G | Out-Null } - -$qargs = @( - '-accel', 'whpx,kernel-irqchip=off', '-machine', 'q35', '-cpu', 'max', '-smp', '6', '-m', '8G', - '-drive', "if=pflash,format=raw,readonly=on,file=$code", - '-drive', 'if=pflash,format=raw,file=vars.fd', - '-drive', 'file=disk.qcow2,if=virtio', - '-device', 'virtio-vga,xres=1920,yres=1080', '-display', 'sdl', - '-device', 'qemu-xhci', '-device', 'usb-tablet', - '-nic', 'user,model=virtio-net-pci,hostfwd=tcp::2222-:22' -) -if ($Install) { $qargs += @('-cdrom', 'cachyos.iso', '-boot', 'd') } - -& $qemu @qargs