2012-12-05 07:46:53 -05:00
|
|
|
---
|
2021-03-13 13:06:18 -05:00
|
|
|
lang: en
|
2015-04-10 16:17:45 -04:00
|
|
|
layout: doc
|
2021-06-20 23:55:57 -04:00
|
|
|
permalink: /doc/standalones-and-hvms/
|
2015-10-11 03:04:59 -04:00
|
|
|
redirect_from:
|
2021-06-20 23:55:57 -04:00
|
|
|
- /doc/standalones-and-hvm/
|
2021-06-18 05:29:28 -04:00
|
|
|
- /doc/standalone-and-hvm/
|
2019-09-02 05:34:26 -04:00
|
|
|
- /doc/hvm/
|
2016-05-04 09:16:34 -04:00
|
|
|
- /doc/hvm-create/
|
2015-10-28 18:14:40 -04:00
|
|
|
- /en/doc/hvm-create/
|
2015-10-11 03:04:59 -04:00
|
|
|
- /doc/HvmCreate/
|
|
|
|
- /wiki/HvmCreate/
|
2021-03-13 13:06:18 -05:00
|
|
|
ref: 130
|
2021-06-18 05:29:28 -04:00
|
|
|
title: Standalones and HVMs
|
2012-12-05 07:46:53 -05:00
|
|
|
---
|
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
A [standalone](/doc/glossary/#standalone) is a type of qube that is created by
|
|
|
|
cloning a [template](/doc/glossary/#template). Unlike templates, however,
|
|
|
|
standalones do not supply their root filesystems to other qubes. Examples of
|
|
|
|
situations in which standalones can be useful include:
|
|
|
|
|
|
|
|
- Qubes used for development (dev environments often require a lot of specific
|
|
|
|
packages and tools)
|
|
|
|
- Qubes used for installing untrusted packages. Normally, you install digitally
|
|
|
|
signed software from Red Hat/Fedora repositories, and it's reasonable that
|
|
|
|
such software has non malicious *installation* scripts (rpm pre/post
|
|
|
|
scripts). However, when you would like to install some packages from less
|
|
|
|
trusted sources, or unsigned, then using a dedicated (untrusted) standalone
|
|
|
|
might be a better way.
|
|
|
|
|
|
|
|
Meanwhile, a [Hardware-assisted Virtual Machine (HVM)](/doc/glossary/#hvm),
|
|
|
|
also known as a "Fully-Virtualized Virtual Machine," utilizes the
|
|
|
|
virtualization extensions of the host CPU. These are typically contrasted with
|
|
|
|
Paravirtualized (PV) VMs.
|
|
|
|
|
|
|
|
HVMs allow you to create qubes based on any OS for which you have an
|
|
|
|
installation ISO, so you can easily have qubes running Windows, \*BSD, or any
|
|
|
|
Linux distribution. You can also use HVMs to run "live" distros.
|
|
|
|
|
|
|
|
By default, every qube runs in PVH mode (which has security advantages over
|
|
|
|
both PV and HVM), except for those with attached PCI devices, which run in HVM
|
|
|
|
mode. See [here](https://blog.invisiblethings.org/2017/07/31/qubes-40-rc1.html)
|
|
|
|
for a discussion of the switch from PV to HVM and
|
|
|
|
[here](/news/2018/01/11/qsb-37/) for the announcement about the change to using
|
|
|
|
PVH as default.
|
|
|
|
|
|
|
|
The standalone/template distinction and the HVM/PV/PVH distinctions are
|
|
|
|
orthogonal. The former is about root filesystem inheritance, whereas the latter
|
|
|
|
is about the virtualization mode. In practice, however, it is most common for
|
|
|
|
standalones to be HVMs and for HVMs to be standalones. Hence, this page covers
|
|
|
|
both topics.
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-06-18 05:29:28 -04:00
|
|
|
## Creating a standalone
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
You can create a standalone in the Qube Manager by selecting the "Type" of
|
|
|
|
"Standalone qube copied from a template" or "Empty standalone qube (install
|
|
|
|
your own OS)."
|
2019-09-02 05:34:26 -04:00
|
|
|
|
|
|
|
Alternatively, from the dom0 command line:
|
2012-12-05 07:46:53 -05:00
|
|
|
|
2019-09-02 05:34:26 -04:00
|
|
|
```
|
2024-01-02 18:41:57 -05:00
|
|
|
qvm-create --class StandaloneVM --label <YOUR_COLOR> --property virt_mode=hvm --template <TEMPLATE_QUBE_NAME> <NEW_STANDALONE_NAME>
|
2019-09-02 05:34:26 -04:00
|
|
|
```
|
|
|
|
|
2024-01-02 18:41:57 -05:00
|
|
|
Notes:
|
|
|
|
- Technically, `virt_mode=hvm` is not necessary for every standalone.
|
|
|
|
However, it makes sense if you want to use a kernel from within the qube.
|
|
|
|
- If you want to make available the software installed in a template qube in your standalone, pass its name to `--template` option.
|
2019-09-02 05:34:26 -04:00
|
|
|
|
2021-06-20 23:43:43 -04:00
|
|
|
## Updating standalones
|
|
|
|
|
|
|
|
When you create a standalone from a template, the standalone is a complete
|
|
|
|
clone of the template, including the entire filesystem. After the moment of
|
|
|
|
creation, the standalone becomes completely independent from the template.
|
|
|
|
Therefore, the standalone will not be updated merely by updating the template
|
|
|
|
from which it was originally cloned. Rather, it must be updated as an
|
|
|
|
independent qube. See [How to Update](/doc/how-to-update/).
|
|
|
|
|
2019-09-02 05:34:26 -04:00
|
|
|
## Creating an HVM
|
2012-12-05 07:46:53 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
### Using the GUI
|
2021-03-13 12:03:23 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
In Qube Manager, select "Create new qube" from the Qube menu, or select the
|
|
|
|
"Create a new qube" button. In the "create new qube" dialog box set Type to
|
|
|
|
"Empty standalone qube (install your own OS)". If "install system from device"
|
|
|
|
is selected (which it is by default), then `virt_mode` will be set to `hvm`
|
|
|
|
automatically. Otherwise, open the newly-created qube's Settings GUI and, in
|
|
|
|
the "Advanced" tab, select `HVM` in the virtualization mode drop-down list.
|
2018-06-30 11:16:31 -04:00
|
|
|
Also, make sure "Kernel" is set to `(none)` on the same tab.
|
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
### Command line
|
2021-03-13 12:03:23 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
Qubes are template-based (i.e., [app qubes](/doc/glossary/#app-qube) by
|
|
|
|
default, so you must set the `--class StandaloneVM` option to create a
|
|
|
|
standalone. The name and label color used below are for illustration purposes.
|
2021-03-13 12:03:23 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-06-30 11:16:31 -04:00
|
|
|
qvm-create my-new-vm --class StandaloneVM --property virt_mode=hvm --property kernel='' --label=green
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2012-12-05 07:46:53 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
If you receive an error like this one, then you must first enable VT-x in your
|
|
|
|
BIOS:
|
2016-04-15 23:33:46 -04:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2017-11-18 03:11:47 -05:00
|
|
|
libvirt.libvirtError: invalid argument: could not find capabilities for arch=x86_64
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2016-04-15 23:33:46 -04:00
|
|
|
|
2019-07-10 00:26:09 -04:00
|
|
|
Make sure that you give the new qube adequate memory to install and run.
|
|
|
|
|
2019-09-02 05:34:26 -04:00
|
|
|
## Installing an OS in an HVM
|
2012-12-05 07:46:53 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
You will have to boot the qube with the installation media "attached" to it.
|
|
|
|
You may either use the GUI or use command line instructions. At the command
|
|
|
|
line you can do this in three ways:
|
2012-12-12 06:37:22 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
1. If you have the physical CD-ROM media and an optical disc drive:
|
2021-03-13 12:03:23 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
|
|
|
qvm-start <YOUR_HVM> --cdrom=/dev/cdrom
|
|
|
|
```
|
2021-03-13 12:03:23 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
2. If you have an ISO image of the installation media located in dom0:
|
2021-03-13 12:03:23 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
|
|
|
qvm-start <YOUR_HVM> --cdrom=dom0:/usr/local/iso/<YOUR_INSTALLER.ISO>
|
|
|
|
```
|
2021-03-13 12:03:23 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
3. If you have an ISO image of the installation media located in a qube (the
|
|
|
|
qube where the media is located must be running):
|
2021-03-13 12:03:23 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
|
|
|
qvm-start <YOUR_HVM> --cdrom=<YOUR_OTHER_QUBE>:/home/user/<YOUR_INSTALLER.ISO>
|
|
|
|
```
|
2013-01-02 08:44:26 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
For security reasons, you should *never* copy untrusted data to dom0.
|
2012-12-05 08:03:19 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
Next, the qube will start booting from the attached installation media, and you
|
|
|
|
can start installation. Whenever the installer wants to "reboot the system" it
|
|
|
|
actually shuts down the qube, and Qubes won't automatically start it. You may
|
|
|
|
have to restart the qube several times in order to complete installation (as is
|
|
|
|
the case with Windows 7 installations). Several invocations of the `qvm-start`
|
|
|
|
command (as shown above) might be needed.
|
2016-11-04 08:00:13 -04:00
|
|
|
|
2019-09-02 05:34:26 -04:00
|
|
|
## Setting up networking for HVMs
|
2012-12-08 05:31:48 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
Just like standard app qubes, an HVM gets a fixed IP addresses centrally
|
|
|
|
assigned by Qubes. Normally, Qubes agent scripts (or services on Windows)
|
|
|
|
running within each app qube are responsible for setting up networking within
|
|
|
|
the qube according to the configuration created by Qubes (through
|
|
|
|
[keys](/doc/vm-interface/#qubesdb) exposed by dom0 to the qube). Such
|
|
|
|
centrally-managed networking infrastructure allows for [advanced networking
|
|
|
|
configurations](https://blog.invisiblethings.org/2011/09/28/playing-with-qubes-networking-for-fun.html).
|
|
|
|
|
|
|
|
A generic HVM such as a standard Windows or Ubuntu installation, however, has
|
|
|
|
no Qubes agent scripts running inside it initially and thus requires manual
|
|
|
|
configuration of networking so that it matches the values assigned by Qubes.
|
|
|
|
|
|
|
|
Even though we do have a small DHCP server that runs inside the HVM's untrusted
|
|
|
|
stub domain to make the manual network configuration unnecessary for many
|
|
|
|
qubes, this won't work for most modern Linux distributions, which contain Xen
|
|
|
|
networking PV drivers (but not Qubes tools), which bypass the stub-domain
|
|
|
|
networking. (Their net frontends connect directly to the net backend in the
|
2021-09-13 05:05:27 -04:00
|
|
|
[net qube](/doc/glossary/#net-qube).) In this instance, our DHCP server is not
|
2021-06-23 04:48:00 -04:00
|
|
|
useful.
|
|
|
|
|
|
|
|
In order to manually configure networking in a qube, one should first find out
|
|
|
|
the IP/netmask/gateway assigned to the particular qube by Qubes. This can be
|
|
|
|
seen, e.g., in the Qube Manager in the qube's properties:
|
2012-12-12 07:27:06 -05:00
|
|
|
|
2021-12-04 20:23:41 -05:00
|
|
|
![r4.0-manager-networking-config.png](/attachment/doc/r4.0-manager-networking-config.png)
|
2012-12-12 07:27:06 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
Alternatively, one can use the `qvm-ls -n` command to obtain the same
|
|
|
|
information (IP/netmask/gateway).
|
2012-12-12 07:27:06 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
The DNS IP addresses are `10.139.1.1` and `10.139.1.2`. There is [opt-in
|
|
|
|
support](/doc/networking/#ipv6) for IPv6 forwarding.
|
2012-12-12 07:27:06 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
## Using template-based HVMs
|
2013-11-30 12:43:22 -05:00
|
|
|
|
2021-06-18 05:29:28 -04:00
|
|
|
Qubes allows HVMs to share a common root filesystem from a select template.
|
2021-06-23 04:48:00 -04:00
|
|
|
This mode can be used for any HVM (e.g., FreeBSD running in an HVM).
|
2019-07-10 00:26:09 -04:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
In order to create an HVM template, you use the following command, suitably
|
|
|
|
adapted:
|
2019-07-10 00:26:09 -04:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
|
|
|
qvm-create --class TemplateVM <YOUR_HVM_TEMPLATE_NAME> --property virt_mode=HVM --property kernel='' -l <YOUR_COLOR>
|
|
|
|
```
|
2019-07-10 00:26:09 -04:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
Set memory as appropriate and install the OS into this template in the same way
|
|
|
|
you would install it into a normal HVM. Generally, you should install in to the
|
|
|
|
first "system" disk. (Resize it as needed before starting installation.)
|
2019-07-10 00:26:09 -04:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
You can then create a new qube using the new template. If you use this Template
|
|
|
|
as is, then any HVMs based on it it will effectively be disposables. All file
|
|
|
|
system changes will be wiped when the HVM is shut down.
|
2019-07-10 00:26:09 -04:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
Please see [this
|
|
|
|
page](https://github.com/Qubes-Community/Contents/blob/master/docs/os/windows/windows-tools.md)
|
|
|
|
for specific advice on installing and using Windows-based templates.
|
2013-11-30 12:43:22 -05:00
|
|
|
|
2019-09-02 05:34:26 -04:00
|
|
|
## Cloning HVMs
|
2012-12-05 08:03:19 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
Just like normal app qubes, HVMs can also be cloned either using the command
|
|
|
|
`qvm-clone` or via the Qube Manager's "Clone VM" option in the right-click
|
|
|
|
menu.
|
2012-12-12 07:59:27 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
The cloned qube will get identical root and private images and will essentially
|
|
|
|
be identical to the original qube, except that it will get a different MAC
|
|
|
|
address for the networking interface:
|
2012-12-12 07:59:27 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
[joanna@dom0 ~]$ qvm-prefs my-new-vm
|
2021-12-04 20:23:41 -05:00
|
|
|
autostart D False
|
|
|
|
backup_timestamp U
|
|
|
|
debug D False
|
|
|
|
default_dispvm D None
|
|
|
|
default_user D user
|
|
|
|
gateway D
|
|
|
|
gateway6 D
|
|
|
|
include_in_backups - False
|
|
|
|
installed_by_rpm D False
|
|
|
|
ip D 10.137.0.122
|
|
|
|
ip6 D fd09:24ef:4179::a89:7a
|
|
|
|
kernel -
|
|
|
|
kernelopts D nopat
|
|
|
|
klass D StandaloneVM
|
|
|
|
label - red
|
|
|
|
mac D 00:16:3e:5e:6c:00
|
|
|
|
management_dispvm D default-mgmt-dvm
|
|
|
|
maxmem D 0
|
|
|
|
memory - 1000
|
|
|
|
name - my-new-vm
|
|
|
|
netvm - sys-firewall
|
|
|
|
provides_network - False
|
|
|
|
qid - 122
|
|
|
|
qrexec_timeout D 60
|
|
|
|
shutdown_timeout D 60
|
|
|
|
start_time D
|
|
|
|
stubdom_mem U
|
|
|
|
stubdom_xid D -1
|
|
|
|
updateable D True
|
|
|
|
uuid - 54387f94-8617-46b0-8806-0c18bc387f34
|
|
|
|
vcpus D 2
|
|
|
|
virt_mode - hvm
|
|
|
|
visible_gateway D 10.137.0.14
|
|
|
|
visible_gateway6 D fd09:24ef:4179::a89:e
|
|
|
|
visible_ip D 10.137.0.122
|
|
|
|
visible_ip6 D fd09:24ef:4179::a89:7a
|
|
|
|
visible_netmask D 255.255.255.255
|
|
|
|
xid D -1
|
2012-12-12 07:59:27 -05:00
|
|
|
|
2018-02-23 14:02:43 -05:00
|
|
|
[joanna@dom0 ~]$ qvm-clone my-new-vm my-new-vm-copy
|
2012-12-12 07:59:27 -05:00
|
|
|
|
|
|
|
/.../
|
|
|
|
|
2018-02-23 14:02:43 -05:00
|
|
|
[joanna@dom0 ~]$ qvm-prefs my-new-vm-copy
|
2021-12-04 20:23:41 -05:00
|
|
|
autostart D False
|
|
|
|
backup_timestamp U
|
|
|
|
debug D False
|
|
|
|
default_dispvm D None
|
|
|
|
default_user D user
|
|
|
|
gateway D
|
|
|
|
gateway6 D
|
|
|
|
include_in_backups - False
|
|
|
|
installed_by_rpm D False
|
|
|
|
ip D 10.137.0.137
|
|
|
|
ip6 D fd09:24ef:4179::a89:89
|
|
|
|
kernel -
|
|
|
|
kernelopts D nopat
|
|
|
|
klass D StandaloneVM
|
|
|
|
label - red
|
|
|
|
mac D 00:16:3e:5e:6c:00
|
|
|
|
management_dispvm D default-mgmt-dvm
|
|
|
|
maxmem D 0
|
|
|
|
memory - 1000
|
|
|
|
name - my-new-vm-copy
|
|
|
|
netvm - sys-firewall
|
|
|
|
provides_network - False
|
|
|
|
qid - 137
|
|
|
|
qrexec_timeout D 60
|
|
|
|
shutdown_timeout D 60
|
|
|
|
start_time D
|
|
|
|
stubdom_mem U
|
|
|
|
stubdom_xid D -1
|
|
|
|
updateable D True
|
|
|
|
uuid - 9ad109a9-d95a-4e03-b977-592f8424f42b
|
|
|
|
vcpus D 2
|
|
|
|
virt_mode - hvm
|
|
|
|
visible_gateway D 10.137.0.14
|
|
|
|
visible_gateway6 D fd09:24ef:4179::a89:e
|
|
|
|
visible_ip D 10.137.0.137
|
|
|
|
visible_ip6 D fd09:24ef:4179::a89:89
|
|
|
|
visible_netmask D 255.255.255.255
|
|
|
|
xid D -1
|
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2012-12-12 07:59:27 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
Note that the MAC addresses differ between those two otherwise identical qubes.
|
|
|
|
The IP addresses assigned by Qubes will also be different, of course, to allow
|
|
|
|
networking to function properly:
|
2012-12-12 07:59:27 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2012-12-12 07:59:27 -05:00
|
|
|
[joanna@dom0 ~]$ qvm-ls -n
|
2021-12-04 20:23:41 -05:00
|
|
|
|
|
|
|
NAME STATE NETVM IP IPBACK GATEWAY
|
|
|
|
my-new-hvm Halted sys-firewall 10.137.0.122 - 10.137.0.14
|
|
|
|
my-new-hvm-clone Halted sys-firewall 10.137.0.137 - 10.137.0.14
|
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2012-12-12 07:59:27 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
If, for any reason, you would like to make sure that the two qubes have the
|
|
|
|
same MAC address, you can use `qvm-prefs` to set a fixed MAC address:
|
2012-12-12 07:59:27 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
[joanna@dom0 ~]$ qvm-prefs my-new-vm-copy -s mac 00:16:3E:5E:6C:05
|
|
|
|
[joanna@dom0 ~]$ qvm-prefs my-new-vm-copy
|
|
|
|
name : my-new-vm-copy
|
2012-12-12 07:59:27 -05:00
|
|
|
label : green
|
|
|
|
type : HVM
|
|
|
|
netvm : firewallvm
|
|
|
|
updateable? : True
|
|
|
|
installed by RPM? : False
|
|
|
|
include in backups: False
|
2018-02-23 14:02:43 -05:00
|
|
|
dir : /var/lib/qubes/appvms/my-new-vm-copy
|
|
|
|
config : /var/lib/qubes/appvms/my-new-vm-copy/my-new-vm-copy.conf
|
2012-12-12 07:59:27 -05:00
|
|
|
pcidevs : []
|
2018-02-23 14:02:43 -05:00
|
|
|
root img : /var/lib/qubes/appvms/my-new-vm-copy/root.img
|
|
|
|
private img : /var/lib/qubes/appvms/my-new-vm-copy/private.img
|
2012-12-12 07:59:27 -05:00
|
|
|
vcpus : 4
|
|
|
|
memory : 512
|
|
|
|
maxmem : 512
|
|
|
|
MAC : 00:16:3E:5E:6C:05
|
|
|
|
debug : off
|
|
|
|
default user : user
|
|
|
|
qrexec_installed : False
|
|
|
|
qrexec timeout : 60
|
|
|
|
drive : None
|
|
|
|
timezone : localtime
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2012-12-12 07:59:27 -05:00
|
|
|
|
2019-09-02 05:34:26 -04:00
|
|
|
## Assigning PCI devices to HVMs
|
2012-12-11 12:10:36 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
HVMs (including Windows qubes) can be [assigned PCI
|
|
|
|
devices](/doc/how-to-use-pci-devices/) just like normal app qubes. For example,
|
|
|
|
you can assign a USB controller to a Windows qube, and you should be able to
|
|
|
|
use various devices that require Windows software, such as phones, electronic
|
|
|
|
devices that are configured via FTDI, etc.
|
2012-12-11 12:10:36 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
One problem at the moment, however, is that after the whole system gets
|
|
|
|
suspended into S3 sleep and subsequently resumed, some attached devices may
|
|
|
|
stop working and should be restarted within the qube. This can be achieved
|
|
|
|
under a Windows HVM by opening the Device Manager, selecting the actual device
|
|
|
|
(such as a USB controller), 'Disabling' the device, and then 'Enabling' the
|
|
|
|
device again. This is illustrated in the screenshot below:
|
2012-12-11 12:10:36 -05:00
|
|
|
|
2021-06-18 08:46:02 -04:00
|
|
|
![r2b1-win7-usb-disable.png](/attachment/doc/r2b1-win7-usb-disable.png)
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2019-09-02 05:34:26 -04:00
|
|
|
## Converting VirtualBox VMs to Qubes HVMs
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2019-09-02 05:34:26 -04:00
|
|
|
You can convert any VirtualBox VM to a Qubes HVM using this method.
|
2019-07-10 00:26:09 -04:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
For example, Microsoft provides [free 90-day evaluation VirtualBox VMs for
|
|
|
|
browser
|
|
|
|
testing](https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/).
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
About 60 GB of disk space is required for conversion. Use an external hard
|
|
|
|
drive if needed. The final `root.img` size is 40 GB.
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
In a Debian app qube, install `qemu-utils` and `unzip`:
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
sudo apt install qemu-utils unzip
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2021-12-10 07:05:32 -05:00
|
|
|
In a Fedora app qube:
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo dnf install qemu-img
|
|
|
|
```
|
|
|
|
|
2018-02-23 14:02:43 -05:00
|
|
|
Unzip VirtualBox zip file:
|
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
unzip *.zip
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
|
|
|
|
Extract OVA tar archive:
|
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
tar -xvf *.ova
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
|
|
|
|
Convert vmdk to raw:
|
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
qemu-img convert -O raw *.vmdk win10.raw
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
Copy the root image file from the originating qube (here called `untrusted`) to
|
|
|
|
a temporary location in dom0, typing this in a dom0 terminal:
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-03-19 04:37:59 -04:00
|
|
|
qvm-run --pass-io untrusted 'cat "/media/user/externalhd/win10.raw"' > /home/user/win10-root.img
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
From within dom0, create a new HVM (here called `win10`) with the root image we
|
|
|
|
just copied to dom0 (change the amount of RAM in GB as you wish):
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2019-10-04 08:06:24 -04:00
|
|
|
qvm-create --property=virt_mode=hvm --property=memory=4096 --property=kernel='' --label red --standalone --root-move-from /home/user/win10-root.img win10
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
Start `win10`:
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
qvm-start win10
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
### Optional ways to get more information
|
2018-02-23 14:02:43 -05:00
|
|
|
|
|
|
|
Filetype of OVA file:
|
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
file *.ova
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
|
|
|
|
List files of OVA tar archive:
|
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
tar -tf *.ova
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
|
|
|
|
List filetypes supported by qemu-img:
|
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
qemu-img -h | tail -n1
|
2021-06-23 04:48:00 -04:00
|
|
|
```
|
2018-02-23 14:02:43 -05:00
|
|
|
|
2019-09-02 05:34:26 -04:00
|
|
|
## Further reading
|
2013-01-08 07:55:47 -05:00
|
|
|
|
2021-06-23 04:48:00 -04:00
|
|
|
Other documents related to HVMs:
|
2013-01-08 07:55:47 -05:00
|
|
|
|
2021-06-18 05:29:28 -04:00
|
|
|
- [Windows VMs](https://github.com/Qubes-Community/Contents/blob/master/docs/os/windows/windows-vm.md)
|
2023-08-15 02:34:37 -04:00
|
|
|
- [Linux HVM Tips](https://forum.qubes-os.org/t/19008)
|