配备外置图形处理器的 NitroPC Pro 2#

注解

本指南只有在使用 Nitrokey 提供的 Qubes OS OEM GPU 镜像时才有效,您可以在`here`_.

本指南介绍如何在 Qubes OS 中使用带有外置图形卡(GPU)的 NitroPC。

警告

遵循本指南可能会在 Qubes OS 中产生一些安全问题。请自行承担风险。

创建 Windows Qube#

注解

这将从正式试用版 ISO 安装 Windows Qube。如果您想要完整的 Windows 体验,则需要添加许可证密钥。

本部分使用`ElliotKillick 项目<https://github.com/elliotkillick/qvm-create-windows-qube>`__。

  1. 在 dom0 中打开终端,确保已连接互联网。

  2. 安装 Qubes Windows 工具,在 dom0 中:sudo qubes-dom0-update qubes-windows-tools-4.1.69 当要求安装时,按``y`` 并回车。

  1. 使安装脚本可执行,在 dom0 中:sudo chmod +x /install.sh

  2. 在 dom0 中启动安装脚本:/install.sh

如果看到以下信息 :[+] Installation complete!,则可以继续。

此时,脚本会创建一个名为 windows-mgmt 的新 Qube,现在我们将下载 ISO 来创建 Windows Qube。

为此,我们需要将``~/qvm-create-windows-qube/windows/isos/mido.sh`` 脚本从 windows-mgmt Qube 复制到具有互联网连接的一次性 Qube 中。

  1. 启动一个新的 DVM(一次性)Qube,并为其提供至少 10 GB 的私人存储空间。

  2. 启动 windows-mgmt Qube 并复制脚本,在 windows-mgmt Qube 中:qvm-copy qvm-create-windows-qube/windows/isos/mido.sh 然后选择 DVM Qube (dispXXXX)。

  3. 复制脚本后,在 dispXXX 中启动它:./QubesIncoming/windows-mgmt/mido.sh win10x64

注解

在本指南中,我们安装的是 Windows 10,但也有其他 Windows 版本,您可以使用``./QubesIncoming/windows-mgmt/mido.sh`` 列出它们。

  1. 如果收到成功消息,则需要将下载的 ISO 从 DVM 复制到 windows-mgmt Qube,在 dispXXXX :qvm-copy QubesIncoming/windows-mgmt/win10x64.iso 中选择 windows-mgmt Qube。

复制完成后,您就可以关闭 DVM Qube。

  1. 在 windows-mgmt Qube 中:``mv QubesIncoming/dispXXXX/win10x64.iso qvm-create-windows-qube/windows/isos/``(将 “dispXXXX “替换为您创建的一次性 Qube 的名称)。

  2. 那么在 dom0 :``qvm-create-windows-qube -n sys-firewall -oy -i win10x64.iso -a win10x64-pro.xml work-win10``中

注解

您可以从`这个网站<https://community.chocolatey.org/packages>`__预装任何软件包。例如:qvm-create-windows-qube -n sys-firewall -oyp firefox,notepadplusplus,office365proplus -i win10x64.iso -a win10x64-pro.xml work-win10

如果脚本停止或卡住,请重试,直到看到以下信息:[+] Completed successfully!

  1. 现在,您需要将 GPU 连接到 Windows Qube,为此请进入 Qube 管理器和 Windows 10 Qube 选项(确保 Qube 已关闭),在 “设备 “选项卡下选择显卡并将其传递到右侧,然后点击``Configure strict reset for PCI devices``,然后选择显卡并点击``OK``。

  2. 现在显卡已连接到 Windows Qube,您需要安装显卡的驱动程序。在搜索栏中搜索``Check for updates``,然后点击``Check for updates``(需要重启几次)。

现在,Windows 将安装使用外置显卡所需的所有驱动程序。如果遇到问题,请确保在安装更新时 Windows Qube 有足够的空间。

完成后,您就可以将辅助显示器连接到显卡。

如果您想在 Windows Qube 上使用专用鼠标或键盘,则需要使用 sys-usb,并将所需设备连接到它。

创建 Linux Qube#

蝶变#

  1. 进入 Qube 管理器,创建一个新的独立 Qube,并在创建后启动设置。

  2. 在 “建议 “选项卡中,将模式更改为 HVM,禁用内存均衡,并选择所需的内存大小。

  3. 在 “设备 “选项卡中选择 GPU 并将它移到右侧,然后点击``Configure strict reset for PCI devices``,然后选择你的显卡并点击``OK``。

  4. 关闭设置并启动 Qube。

  5. 将 non-free 添加到源代码列表:sudo sed -i '1 s/.*/& non-free/' /etc/apt/sources.list

  6. sudo apt update

  7. sudo apt install nvidia-driver dbus-x11

现在,您需要创建 3 个不同的文件:

screen.conf::

Section "Device"
Identifier  "GPU"

# name of the driver to use. Can be "amdgpu", "nvidia", or something else
Driver      "nvidia"

# The BusID value will change after each qube reboot.
BusID       "PCI:0:8:0"
EndSection

Section "Screen"
Identifier "GPU screen"
Device     "GPU"
EndSection

xorgX1.sh::

#!/bin/bash

binary=${1:?binary required}

# Find the correct BusID of the AMD GPU, then set it in the Xorg configuration file
pci=$(lspci | grep "VGA" | grep -E "NVIDIA|AMD/ATI" | cut -d " " -f 1 | cut -d ":" -f 2 | cut -d "." -f 1 | cut -d "0" -f 2)
sed -i 's/"PCI:[^"]*"/"PCI:0:'$pci':0"/g' /home/user/screen.conf

# Start the Xorg server for the X screen number 1.
# The X screen n°0 is already used for QubesOS integration
sudo startx "$binary" -- :1 -config /home/user/screen.conf

xfce.sh::

#!/bin/bash
sleep 5 && sudo setxkbmap -display :1 fr &
/bin/sudo -u user PULSE_SERVER=unix:/run/user/1000/pulse/native bash -c 'sudo xhost + local:;/usr/bin/startxfce4'
  1. sudo chmod +x xorgX1.sh xfce.sh

  2. sudo ./xorgX1.sh ./xfce.sh

现在副屏幕应该会打开,并显示 Debian XFCE 桌面。

如果要在 Linux Qube 上使用专用鼠标或键盘,则需要使用 sys-usb,并将所需设备连接到它。