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

备注

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

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

警告

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

创建 Windows Qube

备注

This will install a Windows Qube from the official trial ISO. If you want a full Windows experience then you will need to add a license key.

本部分使用`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`` 并回车。

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

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

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

    At this point the script created a new Qube called windows-mgmt now we will download the ISO to create the Windows Qube.

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

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

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

  7. Once the script is copied launch it, in dispXXXX : ./QubesIncoming/windows-mgmt/mido.sh win10x64

    备注

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

  8. If you get a success message then you will need to copy the downloaded ISO from the DVM to the windows-mgmt Qube, in dispXXXX : qvm-copy QubesIncoming/windows-mgmt/win10x64.iso and choose the windows-mgmt Qube.

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

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

  10. 那么在 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!

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

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

Now Windows will install all the drivers you will need to use your external graphic card. If you're experiencing some problems make sure that you have enough space in your Windows Qube while installing updates.

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

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

创建 Linux Qube

蝶变

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

  2. In the "Advanced" tab change the mode to HVM and disable memory balancing and choose the amount of RAM you want.

  3. In the devices tab select the GPU and pass it to the right then click on the Configure strict reset for PCI devices then select your card and click 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

    Now you will need to create 3 different files:

    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'
    
  8. sudo chmod +x xorgX1.sh xfce.sh

  9. sudo ./xorgX1.sh ./xfce.sh

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

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