Как из домашнего пк средствами виртуализации сохранить игровую систему
Содержание:
Binding Devices to pci-stub
If using pv-ops dom0, also can use pci-stub to hide devices for assignment (example PCI device 01:00.0) * lspci -n * locate the entry for device 01:00.0 and note down the vendor & device ID 8086:10b9 .
Note: Binding devices with pci-stub only works for pci passthrough to HVM guests! Hiding with xen-pciback as mentioned above works for both HVM and PV guests and is preferred.
... 01:00.0 0200: 8086:10b9 (rev 06) ...
then use following commands to hide it: .
echo "8086 10b9" > /sys/bus/pci/drivers/pci-stub/new_id echo "0000:01:00.0" > /sys/bus/pci/devices/0000:01:00.0/driver/unbind echo "0000:01:00.0" > /sys/bus/pci/drivers/pci-stub/bind
Как зайти в настройки BIOS, UEFI
Зайти в настройки BIOS (UEFI) можно только во время включение или перезагрузки компьютера. Для входа необходимо в относительно небольшой промежуток времени после включения компьютера и до начала загрузки Windows успеть нажать специальную кнопку.
Чаще всего для входа в настройки BIOS служит кнопка Del (Delete). На некоторых компьютерах вместо Del может использоваться кнопка F2 или другие клавиши.
Чтобы гарантированно успеть войти в BIOS (UEFI), лучше сразу же после включения (перезагрузки) компьютера начать периодически нажимать соответствующую кнопку (с интервалом 1-2 раза в секунду).
Какую кнопку нужно нажимать для входа в BIOS, компьютер «подсказывает» вскоре после начала загрузки. Достаточно лишь присмотреться. Надпись типа «Press Del to enter setup», «Del — setup» или другая похожая фраза свидетельствует о необходимости нажатия кнопки Del. Если в такой надписи вместо Del будет F2, значит нажимать нужно F2. Если другая кнопка – нажимать следует ее.
На разных компьютерах меню BIOS, как и меню UEFI, может существенно отличаться. Все зависит от их версии. Меню настроек BIOS, как правило, представляет собой разделы (вкладки) на английском языке на синем или белом фоне. В каждом таком разделе размещены конкретные параметры компьютера. Значение большинства из них можно изменять. Меню настройки UEFI в графическом плане выглядит несколько привлекательней BIOS, хотя структура и принципы навигации по нему ничем не отличаются (см. изображения ниже: 1 – BIOS, 2 – UEFI).


Для перехода между разделами служат клавиши со стрелками «Вправо» и «Влево».
Выбор конкретного параметра в открытом разделе осуществляется клавишами со стрелками «Вверх» и «Вниз». Изменение выбранного параметра чаще всего производится нажатием клавиш «Enter», «+», «-« или вводом конкретных числовых показателей. В любом случае, разобраться в порядке изменения параметров BIOS (UEFI) не сложно. Тем более, что в правой части меню есть подсказки по этому поводу.
В UEFI для навигации и изменения настроек можно пользоваться мышкой.
Чтобы сохранить внесенные в BIOS (UEFI) изменения и продолжить загрузку компьютера с их учетом, нужно нажать клавишу F10 и затем Enter.
Для выхода из BIOS (UEFI) без сохранения изменений необходимо нажать Esc и затем Enter.
SWIOTLB
Software Input Output Translation Lookaside Buffer is an Intel technology which sort of bypasses the IOMMU and allows for a much more configurable memory management interface. Without going into the deep complexity of how this works, page tables are cached in the Lookaside Buffer reducing the need to constantly access physical RAM to map memory. This technology is also referred to as a bounce buffer as the physical address of the memory map is held in this virtual space of and IO is bounced between the physical IO and the Physical memory by this virtual lookaside buffer.
This allows the memory mapping to be carried out quickly and have a physical memory space available for use much faster than if it had to be created physically in RAM and presented to the system as usable.
Each IO TLB is referred to as a slab, this can be found in the swiotlb.h kernel header source file:
FILE
* Maximum allowable number of contiguous slabs to map,
* must be a power of 2. What is the appropriate value ?
* The complexity of {map,unmap}_single is linearly dependent on this value.
#define IO_TLB_SEGSIZE 128
* log of the size of each IO TLB slab. The number of slabs is command line
* controllable.
*
So this mean 1MB would be 8 slabs and the value used as the boot parameter is in slabs NOT size.
| Attribute | Description and options |
|---|---|
| This specifies the amount of slabs to be used by IOTLB, each slab consists of 128K each which is 8 slabs per 1Mb(1024K), so a 64MB SWIOTLB would consist of 512 slabs. You can increase or decrease this value to allow for more buffering of virtual memory addresses in the buffer or not. Default is 64MB or 512 slabs. | |
| This option will force all system IO through the SWIOTLB so there will be no IOMMU controlled by the BIOS or the IOMMU driver elsewhere if one existed. |
Boot-Time VT-d Device Pass-Through
As the name suggests, boot-time pass-through occurs at HVM domU (guest) boot-time. It is also referred to as static VT-d device pass-through, however, this name is confusing as devices attached using this method may subsequently be hot-unplugged. To configure static pass-through for a domain add a «pci» line to the configuration file for the domain. For example, the following may be added to /etc/xen/hvm.conf:
pci =
After updating the configuration file, start HVM guest and use «lspci» to verify that the the pass-through device is present in the guest. «ifconfig» or «ip addr show» may be used to see if IP address has been assigned to NIC devices.
Virtual Slot Designation
As of Xen 3.4.0 it is possible to specify the virtual slot that is used for by boot-time VT-d device pass-through. This is optional and when done is specified on a per-device basis by appending @SLOT_NUMBER to the BDF. For example, the following assigns 00:02.0 to virtual slot 7 while leaving xen to choose the slot for 01:00.0:
pci =
Загрузка с помощью «Boot Menu»
Есть более простой и удобный способ загрузки с DVD-диска или флешки как для BIOS, так и для UEFI – загрузка с помощью «Boot Menu» («Меню Загрузки»).
Для вызова меню загрузки могут использоваться клавиши «F8», «F10», «F11», «F12» или «Esc». Их часто можно увидеть в подсказках на начальном экране загрузки компьютера. Еще эту информацию можно узнать из инструкции, на сайте производителя материнской платы или ноутбука, поиском в интернете или методом тыка.
Сразу после включения компьютера зажмите и удерживайте клавишу вызова «Boot Menu» до появления меню выбора загрузочного устройства.
С помощью стрелочек «вниз» и «вверх» перейдите на DVD-привод или флешку и нажмите «Enter». Sandisk Cruzer
Плюсы такого способа очевидны – не нужно копаться в BIOS, не нужно потом возвращать настройки BIOS обратно (хотя это не всегда обязательно) и достаточно вызвать это меню всего один раз, так как после начала установки Windows это уже не потребуется. Кроме того, использование «Boot Menu» не изменяет настройки BIOS или UEFI.
Как настроить биос — основные разделы
MAIN — раздел для:
- непосредственной корректировки временных данных;
- определения и изменения некоторых параметров винчестеров (жестких дисков) после их выбора с помощью «стрелок» клавиатуры и нажатия кнопки «Ввод» (Enter). Рисунок 1.

В меню Main BIOS Setup вы попадаете сразу, как зайдете в БИОС
Если вы хотите перестроить режимы винчестера, то после нажатия кнопки «Ввод» вы попадете в его меню по умолчанию. Для нормальной работы необходимо выставить «стрелками» и кнопкой «Ввод» в пунктах:
- LBA Large Mode — Auto;
- Block (Multi-Sector Transfer) — Auto;
- PIO Mode — Auto;
- DMA Mode — Auto;
- 32 Bit Transfer — Enabled;
- Hard Disk Write Protect — Disabled;
- Storage Configuration — желательно не изменять;
- SATA Detect Time out — изменять нежелательно.
- Configure SATA as — выставить на AHCI.
- System Information — данные о системе, которые можно почитать.
ADVANCED — раздел непосредственных настроек основных узлов компьютера. Рисунок 2. Он состоит из подразделов:
- JumperFree Configuration — из него (нажатием кнопки «Ввод» (Enter)) попадаем в меню Configure System Frequency/Voltage, которое позволяет настраивать модули памяти и процессор. Оно состоит из пунктов:
- AI Overclocking (режимы Auto и Manual) служит для разгона процессора вручную или автоматически;
- DRAM Frequency — изменяет частоту (тактовую) шины модулей памяти;
- Memory Voltage — ручная смена напряжения на модулях памяти;
- NB Voltage — ручная смена напряжения на чипсете.
- CPU Configuration — при нажатии кнопки «Ввод» (Enter) открывается меню, в котором можно просматривать и изменять некоторые данные процессора.
- Chipset — менять не рекомендуется.
- Onboard Devices Configuration — смена настроек некоторых портов и контролеров:
- Serial Portl Address — смена адреса COM-порта;
- Parallel Port Address — смена адреса LPT-порта;
- Parallel Port Mode — смена режимов параллельного (LPT) порта и адресов некоторых других портов.
Подготовка
Самый первый шаг — настройка параметров ядра. Обязательна поддержка и , желательна поддержка туннельных интерфейсов и сетевого моста. Полный список на .
Подготовьте дисковое пространство. Я выделил 70 GiB, и Windows 8.1 за пару месяцев использовала почти 50 GiB так, что для обновления до 10-й версии места на диске не хватило.
Далее, нам понадобится набор редхатовских драйверов . Если у вас установлен RedHat, достаточно запустить
и образ iso будет записан в каталог . Также можно его скачать с репозитариев Fedora.Убедитесь, что поддержка аппаратной виртуализация включена в BIOS/UEFI. Без этого не будет активирован, а выдаст вот такую ошибку.
В качестве проверки можно прочитать файл устройства.
Если файл не обнаружен, а опции ядра выставлены верно, значит дело в настройках .
Устанавливаем нужные пакеты.
Для RedHat 7 достаточно установить только , так как устанавливается по умолчанию.
Дебианщикам надо установить пакет .
Можно теперь переходить к установке.
VT-d boot parameter: iommu
VT-d is disabled by default, to enable it, need ‘iommu’ parameter to enable it.
- off|no|false|disable: Disable IOMMU (default)
- pv: Enable IOMMU for PV domains
- no-pv: Disable IOMMU for PV domains (default)
- force|required: Don’t boot unless IOMMU is enabled
- workaround_bios_bug: Workaround some bios issues to still enable VT-d, don’t guarantee security
- pass-through: Enable VT-d DMA pass-through (no DMA translation for Dom0)
- no-snoop: Disable VT-d Snoop Control
- no-qinval: Disable VT-d Queued Invalidation
- no-intremap: Disable VT-d Interrupt Remapping
- verbose: In Xen 4.0.0 and newer, enable verbose logging while enabling IOMMU and parsing ACPI DMAR tables
Usually, you just need ‘iommu=1’ to enable VT-d. At the same time, most of VT-d features (DMA remapping, snoop control, queued invalidation and interrupt remapping) are enabled by default if they are available. You can use ‘no-xxx’ to disable a feature, for example, ‘iommu=no-snoop’ disable snoop control.
When RMRR address range is not in reserved memory (BIOS issue), can use ‘iommu_inclusive_mapping=1’ to work around it.
The grub configuration is like:
title Xen-Linux (2.6.18-xen)
root (hd0,0)
kernel /boot/xen.gz iommu=1
module /boot/vmlinuz-2.6.18.8-xen root=LABEL=/
module /boot/initrd-2.6.18-xen.img
IOMMU
This is Input Output Memory Management Unit. In every system this hardware is integrated into a north bridge controller which setup the memory and is programmed by the firmware on your main-board. In recent years manufacturers have stopped integrating this as a North-Bridge chip and integrated it into the CPU itself. This is why if you want to upgrade your memory speed, type and so on you are now required to not only change the motherboard but the CPU as well.
Regardless the kernel needs to setup and read the mappings to be able to use your system memory efficiently.
Installation
Kernel
Move to the kernel directory and open the menuconfig utility:
Set the following options:
KERNEL Example of IOMMU settings kernel
Device Drivers --->
IOMMU Hardware Support --->
Generic IOMMU Pagetable Support ----
AMD IOMMU support
Export AMD IOMMU statistics to debugfs
<M> AMD IOMMU Version 2 driver
Support for Intel IOMMU using DMA Remapping Devices
Support for Shared Virtual Memory with Intel IOMMU
Enable Intel DMA Remapping Devices by default
Support for Interrupt Remapping
The above will allow the kernel to control the mappings in the Memory Mapping controller.
Build and install the kernel:
Configuration
The following options for controlling aspects of the memory mapping will need to be added to the kernel command-line in order to take effect. Doing so varies depending on the system’s bootloader. Common bootloaders include GRUB2 and Lilo. More information on bootloaders can be found here.
Generic options
| Attribute | Description and options |
|---|---|
| This disables the IOMMU driver completely. | |
| Don’t force hardware IOMMU usage when it is not neede. | |
| The use of the hardware IOMMU even when it is not actually needed (e.g. because < 3 GB memory). | |
| Use software bounce buffering (SWIOTLB) (default for Intel machines). This can be used to prevent the usage of an available hardware IOMMU. (read bellow for Intel SWIOTLB). |
AMD64 systems
| Attribute | Description and options |
|---|---|
| ,,, | Enable flushing of IO/TLB entries they are unmapped. Otherwise they are flushed before they will be reused, which is a lot of faster. = do not initialize any AMD IOMMU found in the system. = Force device isolation for all devices. The IOMMU driver is not allowed anymore to lift isolation requirements as needed. This option does not override . |
| , | This is a boolean option: = disabled, = enabled This is to dump the ACPI table for AMD IOMMU. With this option enabled, AMD IOMMU driver will print ACPI tables for AMD IOMMU during IOMMU initialization. |
| , | Specifies one of the following AMD IOMMU interrupt remapping modes: = Use legacy interrupt remapping. = Use virtual APIC mode, which allows IOMMU to inject interrupts directly into guest. This mode requires . (Default when IOMMU HW support is present.) |
Intel systems
Intel generally adopts «an-always-enable-it-if-it-is-supported» rule so most options are to turn off or disable the IOMMU functions.
| Attribute | Description and options |
|---|---|
| , | This is a boolean option: = enabled, = disabled. |
| This option turns off mapping for a graphics card and is the default state for this option. The gfx is mapped as normal device. If a gfx device has a dedicated DMAR unit, the DMAR unit is bypassed by not enabling DMAR with this option. In this case the gfx device will use physical address for DMA. | |
| With this option iommu will not optimize to look for io virtual address below 32-bit forcing dual address cycle on pci bus for cards supporting greater than 32-bit addressing. The default is to look for translation below 32-bit and if not available then look in the higher range. | |
| The default setting for this is disabled. This option on every unmap_single operation will result in a hardware IOTLB flush operation as opposed to batching them for performance. | |
| Super Page which is by default enabled if supported, you can turn this off using this option. | |
| By default, extended context tables will be supported if the hardware advertises that it has support both for the extended tables themselves, and also PASID support. With this option set, extended tables will not be used even on hardware which claims to support them. |
Раздел BOOT – управление загрузкой
Непосредственная загрузка управляется с помощью параметров, находящихся в разделе BOOT.
Здесь разрешается определять приоритетный накопитель, выбирая между флеш-картой, дисководом или винчестером.

Если жёстких дисков несколько, то в подпункте Hard Disk выбирается приоритетный винчестер.
Загрузочная конфигурация ПК устанавливается в подразделе Boot Setting, содержащем меню, состоящем из нескольких пунктов:

Загрузочная конфигурация ПК устанавливается в подразделе Boot Setting,

Подраздел Boot Setting
Содержащее меню, состоит из нескольких пунктов:
- Quick Boot – ускорение загрузки ОС;
- Logo Full Screen – отключение заставки и активация информационного окна, содержащего сведения о процессе загрузки;
- Add On ROM — установка очерёдности на информационном экране модулей, соединённых с материнской платой (МТ) посредством слотов;
- Wait For ‘F1′ If Error — активация функции принудительного нажатия «F1» в момент идентификации системой ошибки.
Основная задача раздела Boot состоит в определении устройств загрузки и задания требуемых приоритетов.

Пошаговая инструкция по правильной настройке BIOS на компьютере
BIOS является системной программой, вшитой в специальный чип, расположенный на материнской плате любого компьютера. Настройка bios позволяет немного подкорректировать некоторые параметры вашего ПК и увеличить его работоспособность.
Бытует неправильное мнение, что настройка bios собьется при отсутствии напряжения. Чтобы этого не случилось, на «материнку» ставят литиевый аккумулятор или специальную батарейку, поддерживающую настройки биоса на компьютере по умолчанию. Эта программа является посредником и обеспечивает взаимодействие устройств с ОС. А как же включить bios?
VT-d Enabled Systems
Note that in addition to the motherboard chipset and BIOS also your CPU must have support for IOMMU IO virtualization (VT-d)! Make sure to check your CPU vendors spec sheets for more information.
CPUs known to work (with a motherboard from below list and a proper BIOS):
- Intel Core2Duo (with VT-x)
- Intel Core2Quad
- Intel Core i7 (see link to Intel reference list above — most «K» versions don’t support VT-d)
- Intel Core i5 (vPro Brand)
- Intel Core i5, i7 Haswell — see link to Intel reference list above — most non-K versions support VT-d
- Intel Xeon E3-1245 V2
- AMD FX-8120 / FX-8150
For VT-d enabling work on Xen, we have been using development systems using following Intel motherboards:
- DQ35MP
- DQ35JO
- Notes on VT-d compatibility:
- VT-d is enabled on the following chipsets:
- Intel Q35 (desktop / workstation)
- Intel Q45 (desktop / workstation)
- Intel X58 (desktop / workstation)
- Intel X79
- Intel 55×0 (server)
- Intel 3450 (workstation / server)
- Intel Z87, H87, Q87 and B85 (information provided by ASRock support)
- VT-d is enabled on the following chipsets:
- The following chipsets have VT-d capability in theory, but most OEMs (such as Asus and Gigabyte) do not have it enabled on boards based on these:
- Intel X38 (desktop / workstation)
- Intel X48 (desktop / workstation)
- Intel 32×0 (server)
- For Intel Desktop Boards, these have VT-d support enabled:
- Intel DQ35JO
- Intel DQ35MP
- Intel DX38BT, DX48BT2 (BIOS 1554 or 1782 required, VT-d is known to not work in other versions; iommu=workaround_bios_bug required)
- Intel DQ45CB (BIOS 0061 required, previous versions are known to cause problems)
- Intel DQ45EK
- Intel DX58SO
- Intel DQ67SW
- For ASUS Desktop Boards, these have VT-d support enabled, but Asus does NOT support Linux, so you are on your own with any Linux or Xen issues like broken BIOSes:
- ASUS P5E-VM DO (Intel Q35 chipset) requires IGD to be enabled (otherwise DMAR-table becomes corrupted)
- ASUS P6T Deluxe (Intel X58 chipset) requires (currently non-public) BIOS update to correct DMAR-table issue
- ASUS P6T documentation claims support, but does not work due to DMAR-table issue
- ASUS P6T6 WS Revolution (Intel X58 chipset) incorrect bios DMAR-table
- ASUS Sabertooth X58 (Intel X58 chipset) incorrect bios DMAR-table (2nd RMRR structure is incorrect)
- ASUS Sabertooth X79 (with BIOS release 1203 and Marvell SATA controller disabled)
- ASUS Z8NA-D6 (dual processor nehalem board) works
- ASUS P8Z77-M PRO unfortunately does not support VT-d notwithstanding that this motherboard can operate with Intel CPUs that do support it such as the i5-3570 — confirmed by an Asus Engineer over e-mail correspondence Aug 3, 17
- Most server boards based on the Tylersburg chipset (55×0), Cougar Point (C20x), Panther Point (C216) and few boards based on 32×0 should have working VT-d, known examples are:
- These motherboards are known to have broken BIOS preventing IO virtualization (VT-d IOMMU) from working:
- Supermicro X7SB4 (with official BIOS 1.2a) has broken ACPI DMAR table with zero length entries. BIOS version 1.3 Beta fixes the problem.
- Samsung X460 laptop: BIOS doesn’t provide DMAR table so VT-d cannot be used.
- As far as we know, following OEM systems also have VT-d enabled. Feel free to add others as they become available.
- VT-d Compatible ASRock Motherboards (Socket 1155, 2011, 1150) probably all Z68 and Z77 board’s
- ASRock H77 Pro4-M
- ASRock Z68 Extreme4 Gen3
- ASRock Z68 Professional Gen3
- ASRock Z77 Pro3
- ASRock Z77 Pro4
- ASRock Z77 Extreme4
- ASRock Z77 Extreme6
- ASRock Z77 Professional
- ASRock X79 Extreme9 (socket 2011)
- all boards based on Z87, H87, Q87 and B85 (information provided by ASRock support)
- no information on cheaper Haswell chipsets (H81 etc), no information on feature set as of June 2013.
- Gigabyte Motherboards (Socket 1155) suggested by manufacturer on inquiry
- GA-X79-UD5 (rev. 1.0)
- GA-X79-UD7 (rev. 1.0)
- GA-Z77X-D3H (rev. 1.0)
- MSI 1155 Motherboards (Socket 1155) suggested by manufacturer on inquiry
- Z68A-GD80-G3
- Z77A-GD80
- Z77A-GD65
- Z77A-GD55
- Z77A-G45
- Z77A-G43