如何在Qubes OS中安装或配置Ubuntu VM(模板VM/应用VM)
Hey there, let's walk through exactly how to set up Ubuntu TemplateVMs and AppVMs in Qubes OS—this process is pretty straightforward once you know the key steps, so let's dive in.
1. Installing the Ubuntu TemplateVM
TemplateVMs are read-only base images that AppVMs inherit from, so we'll start here. You can do this via the GUI or command line—pick whichever you prefer.
GUI Method (Beginner-Friendly)
- Open Qubes Manager (find it in the system tray, or search for it in the app launcher)
- Click the Create VM button in the top-left corner to launch the setup wizard
- Select TemplateVM as the VM type, then click Next
- Under "Operating system", choose the Ubuntu version you want (the latest LTS release like Ubuntu 22.04 is recommended for stability)
- Name your template (stick to lowercase with hyphens, e.g.,
ubuntu-22.04—consistency helps avoid confusion later) - Allocate resources: For a basic Ubuntu template, 4GB of RAM and 20GB of storage should be enough. Adjust if you plan to install lots of heavy software later.
- Check the "Start VM after creation" box if you want the template to finish setting up automatically, then click Finish
- Wait for the download and installation to complete—this can take 5-15 minutes depending on your internet speed.
Command Line Method (For Power Users)
- Open a dom0 terminal: Press
Alt+F3, typexterm, and hit Enter - Run the installation command (replace
22.04with your desired Ubuntu version):sudo qubes-dom0-update qubes-template-ubuntu-22.04 - Enter your dom0 password when prompted, and let the system download and install the template. Once done, it will show up in Qubes Manager automatically.
2. Creating an Ubuntu AppVM from the Template
AppVMs are where you'll actually run applications and store your personal data—they're lightweight and use the TemplateVM's filesystem for core software.
GUI Method
- Go back to Qubes Manager, click Create VM again
- Select AppVM as the VM type, then click Next
- Name your AppVM (e.g.,
ubuntu-workfor work tasks,ubuntu-personalfor personal use) - Under "Template", select the Ubuntu template you just installed (e.g.,
ubuntu-22.04) - Choose a netVM—this is the VM that handles internet access. Unless you have a custom setup, pick
sys-firewall(it routes traffic through yoursys-netVM for security) - Allocate resources: 2GB of RAM is sufficient for general use, and 10GB of storage will hold your files and settings. Adjust as needed.
- Check "Start VM after creation" if you want to launch it right away, then click Finish
Command Line Method
- In your dom0 terminal, run this command (replace labels and names to match your setup):
qvm-create --class AppVM --label green --template ubuntu-22.04 ubuntu-work--label greensets the security color label (use blue, red, or other colors based on your security needs—green is typical for trusted work/personal use)
- To start the AppVM immediately:
qvm-start ubuntu-work
3. Post-Setup Tweaks & Best Practices
- Update the Template: Open a terminal in your Ubuntu TemplateVM (right-click the template in Qubes Manager > Open Terminal), then run:
After updating, shut down the template withsudo apt update && sudo apt upgrade -ysudo poweroff—all AppVMs based on this template will get the updates the next time they start. - Install Persistent Software: Any software you install directly in an AppVM will be lost when you shut it down. To make software permanent, install it in the TemplateVM, then restart your AppVMs.
- Set Default Apps: Right-click your AppVM > Applications > Set Default Applications, then pick your preferred browser, text editor, etc., to launch directly from the app launcher.
- File Sharing: Use the Qubes clipboard (
Ctrl+Shift+Cto copy from a VM,Ctrl+Shift+Vto paste into another) or the file manager's Qubes Send to VM option to transfer files between VMs safely.
4. Troubleshooting Common Issues
- Template Download Fails: Make sure your
sys-netandsys-firewallVMs are running, and dom0 has internet access. If the GUI wizard doesn't work, try the command line method instead. - AppVM Won't Start: Ensure the TemplateVM is shut down (AppVMs can't run if their template is active). Also check that you allocated enough RAM to the AppVM.
- Software Won't Install in AppVM: Remember—AppVMs use a read-only filesystem from the template. For permanent software installs, do it in the TemplateVM, not the AppVM.
内容的提问来源于stack exchange,提问作者user274646
相关产品推荐
相关产品推荐

