Конвертировать vmware в qcow2
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.
David Anderson
New Member
There is lots of information out there about performing these steps, the difficulty is in find the most current and accurate specifically for ProxMox 5.2. I am running the most recent version (5.2) of ProxMox and testing out the ability of using it to replace my VmWare ESXi 5.5.0 server. There is much conflicting information about the process of moving a VMDK, I was hoping someone could point me to some updated information. The Wiki in ProxMox Documentation seems to be discussing version 4, and much of the internet information talks about a process of converting the hard drive to IDE first, installing virtio utilities or using other utilities - while others make no mention of it and just suggest running the conversion on the original VMDK file.
I have experimented with one, only to fail in a "Your PC ran into trouble" boot loop. Theses images are large and cumbersome, and I am hoping to get a process down so I can test more on the actual use of the VM - (e.g. if Windows AD survives the migration etc. ).
Any assistance anyone can provide in the matter is appreciated.
- Uninstall VmWare utilties from original vmdk
- Stop the VM
- Copy the VMDK and the xxx-flat.vmdk files to ProxMox
- run the qemu convert command on the VMDK file [not the flat] to create a single Qcow2 file
- Create a new VM in proxmox with identical hardware resources (e.g. 60G scsi hard drive, ethernet etc. ) so that it will create a new VM ID and hard drive.
- Then replace the newly created Qcow2 file with the converted one from above.
janssensm
Well-Known Member
Drivers
There are several ways to get things done.
But I think the most important part is that you want to choose the scsi disk with virtio-scsi controller as soon as possible in this process.
The prerequisite for that is that Windows already has the virtio storage drivers installed or prestaged.
But there is a catch: installing the drivers is only possible if you have the hardware (virtual, so ESX or Proxmox) presenting this type of storage.
As far as I know, inside VMware you cannot present virtio storage. And inside Proxmox you have to be booted already into OS (or difficult steps within bootrepair. ) to get them installed, which is why some people advise to go with ide storage for first boot, and a dummy virtio-scsi disk to get the drivers installed.
Preparing for prestaging drivers
What I recommend is to prestage the virtio drivers inside ESX, in the same step as you uninstall the vmware tools.
In order to do that you have to download the virtio drivers iso (stable, to be sure) and mount that inside your ESX VM.
You also need to get dpinst.exe which is inside Windows Driver Kit (WDK)
Prestaging divers
Inside your VMware VM, open exporer and go to this location, sort by date, most recent on top
If you succeed in prestaging your driver, you will find it on top of the list.
Now ensure that you have dpinst.exe inside your VM and virtio drivers iso mounted.
Use dpinst to prestage all needed virtio drivers.
Example:
To prestage a the virtio-scsi driver you could run (as local admin):
Convert/migrate your VM
As you now have the virtio drivers prestaged inside your VMware VM, you can proceed in migrating as you want. You could follow the guide with qemu commands, you could also use clonezilla, many options.
Advantage is now you can boot your migrated proxmox VM straight ahead with virtio storage.
Windows should take care of correcting the bootloader. This process depends on what Windows version you are using. More recent versions are better at this.
David Anderson
New Member
OK, I just finished uploading a new copy of the VM - will head back into it and try again! Thanks for your quick reply and detailed response. I will let this thread know how it goes!
Member
@David Anderson
i can "feel" very much with you . i am in the same situation.
the only thing i figured out for me i, that it is the best for "moving" the (mostly large) vmdk file to an NFS volume, which is accessible from ESX and proxmox (and for sideloading tools also from my worksation) works best for transfering VMs.
if i will find a good solution for migrating the harddisk file i will exchange here
@janssensm
thanks for your description . i try it and feedback here
@restofworld
would it be somehow helpfull to use VMDK harddisk type in a migration scenario?
David Anderson
New Member
I tested the steps, then went on VaCa so have not been able to post this response. I followed the steps, and got the drivers for the SCSI controller loaded into my VMDK before I copied it. When trying to boot it into ProxMox - I get the same results, the systems does not find the red hat driver and fails.
- Downloaded Stable virtIO.iso
- Downloaded dpinst.exe (from wdksetup.exe)
- Combined the two on a new DVD
- Launched a copy of the VM in VmWare Player (disabled network, and enabled DVD connected @ power on and inserted new virtIO/dpinst DVD)
- Boot VM - mine asked to upgrade vmdk tools, ignored
- open command prompt on VM
- D: - change to DVD
- D:\dpinst.exe /path D:\vioscsi\2k12r2\amd64\
- Next (in device driver install wizard)
- Would you like to install Red Hat VirtIO ScSi
- Checked always trust RedHat
- Click Install
- sort by date
- vioscsi_inf_amd64k. top of the list
janssensm
Well-Known Member
First I hope you had a nice hollidays.
Just tested myself, X:\windows\system32\DriverStore\FileRepository\ during WIndows recovery mode appears not to be the same content as the real disk content, so rather just a recovery image.As you checked that the driver was installed and inside the driverstore, that should be OK.
Assuming you have virtio-scsi-pci in your VM config.
Just to double check, could you post your VM config?If your config is fine, my guess would be something goes wrong inside the qemu-img conversion.
All my VMDKs use Scsi disks, and I am suspicious that my last attempt failed at the process of copying the VMDK - think I may have gotten into a Veeam snapshot instead of the full VMDK
Could be that this is where your issue starts.
To be sure that everything is inside one vmdk it's wise to clone your vmdk just after the last shutdown into a new vmdk file with vmware-vdiskmanager.exe
I don't think it's installed with Vmware player but you can get it with the VDDK apparently:I would try parameter "-t 0"
Member
i had some time today . so i want to share my current progress
1. goal: migrate a ESXi hosted machine to PVE
(including deinstalling VMWare guest tools and installing PVE guest tools)2. workflow (WIP):
2.0.0 make clone of VM for backup
2.0.1 prepare once: connect NFS store to ESXi and PVE hosts for fast filetranfer
2.1 start VM in ESXi
2.2 uninstall VMWare guest tools (reboot)
2.3 install spice-guest-tools-latest.exe OR install INF files from virtio-win.iso AND inject Mergeide
2.4 disable windows driver signature enforcement:2.5 shutdown VM in ESXi
2.6 copy (or clone) VM to transfer storage (NFS)
2.7 create PVE VM with 2 disk: disk1->virtio sizeof vmdkdisk; disk2->ide sizeof vmdkdisk
2.8 remove disk2 file in shell
2.9 convert vmdk to qcow2: qemu-img convert -f vmdk /mnt/pve/vm-trans/vm1-c/vm1-c.vmdk -O qcow2 disk2.qcow
2.10 set disk2 as boot disk (PV gui Boot Order)
2.11 start VM in PVE
2.12 . login . open windows device manager .. enjoy installed virtio drivers
2.13 en able windows driver signature enforcement:2.14 shutdown
2.15 remove disk1 in shell
2.16 move disk2 to disk1 in shell
2.17 detach and remove disk 2 in PVE gui
2.18 set disk1 as boot disk (PV gui Boot Order)
2.19 start vm in PVE3. open topics:
-> general: just tested with win8.64 . test other platforms
-> step 2.0.1: filetransfer is fast, but images files look like NOT thin . hm . but qemu-ing makes it small again . acceptable
-> step 2.3: to follow the idea of "guest tools" i prefer spice-guest-tools-latest.exe . but driver iso gives more control .
-> step 2.4: my observation: virtio drivers are not MS signed so they are not automatically installed. is it possible to use @janssensm suggestion and combine it with disabling windows driver signature enforcement?
-> step 2.7: need dummy virtio disk for virtio scsi driver installation; and ide disk for 1st time boot
-> step 2.9: i need to try to convert directly into block volumes
-> general: MS tools DISM allows to to more driver handling, but it works only in offline images . i need to prepare an enviroment for thisi highly appreciate any optimization suggestions .
David Anderson
New Member
Was really pretty nice, went to the Upper Penn Mich for a family reunion.
VM Config for troublesome conversion VM:
I was worried about that (getting Veeam Snapshots) so this last one I ran a full Veeam Backup on the original, made sure all snapshots were consolidated before and used it - the veeam backup file was extracted with veeam.backup.extractor.exe and run inside of VMWarePlayer to do the pre-staging. Everything ran as expected and I did not see any noticeable issues.
David Anderson
New Member
Wow akxx great write up - thanks ill check it out and re-read in more detail. To be completely honest to all though, this is already way more trouble than I expected - might be better to just ride out our licenses till i'm ready to rebuild/upgrade the base OS. Given the way the industry (for us anyway) is heading to more Cloud based for larger critical systems and keeping a few non-critical systems in-house for basic LAN services, we may get to where these are needed less and less.
Member
@David Anderson :
well i am also not happy with my "solution".
the main reason for all of this (from my perspective) is, that we do not have microsoft certified virtio drivers OR we have not the fitting redhat certificates in windows cert store.so, i searched for one of these .. and found these snippets
- uninstall vmware guest tools in ESXi
- install readhat cert
- install virtio drivers
- shutdown in ESXi
- create VM in PVE (disk size same size as vmdk)
- transfer / qemu-img VM disk to PVE
(however you do it . for me a NFS share accessible from ESXi and PVE seem to be the fastest method) - start VM
- install guest tools
i am wondering why Proxmox is not offering such a package , or do they - i just do not see it?
user_ks
New Member
Have also been struggling with similar kind of "basic functionality" stuff (euh shit?) with regards to PROXMOX VE.
I lost now already about 20+ hours of relentless research (seriously wasted time), without any decent explanation from PROXMOX documentation whatsoever.This forum post is about one of the MOST BASIC uses cases for PROXMOX VE.
Being the transfer from VMWare virtual machines into the PROXMOX VE environment.
Alias: how to get .vmdk files swiftly/easily and effortlessly up-and-running into the PROXMOX VE environment.
(If the transfer already isn't swift and perfect, how to expect production-grade reliability afterwards ??)I agree with @akxx who expresses in a very gentlemen way "i am wondering why Proxmox is not offering such a package , or do they - i just do not see it?" Right on spot.
After searching for MANY HOURS, sure that I did't find it easily, even at all.
(And this concerns, as said one of the more essential uses cases for PROXMOX VE)Because I was so enthousiast about the PROXMOX VE, I even took a yearly subscription.
Little did I know that it would be so PAINFUL to simply install and get a .vmdk file up and runningSeriously disappointed and dissatisfied about the lack of ease-of-use !
The obvious basic use cases and scenarios should be offered as simple workflows out-of-the box.
Despite many great ICT evolutions and increased possibilities over the last decades, some people think that things better stay complex . grrrrrApologies for my grunts.
And appreciation and gratitude for the question here and the write-ups by @David Anderson, @akxx and @janssensm.dcsapak
Proxmox Staff Member
there you will find the command 'qm importdisk' which imports also vmdk images
transferring files from/to a (proxmox/linux) server is a more general linux administration topic, nothing proxmox specific
Best regards,
DominikDo you already have a Commercial Support Subscription? - If not, Buy now and read the documentation
David Anderson
New Member
I have been running a ProxMox server in my house now for a few weeks and it really is handling things well. I love that its web based (no client to install) it has seemed very stable and keeps chugging right along. The Documentation is out dated (pretty standard for Linux projects), but the forums seem to be kept up - blew my install apart trying to enable multiple hosts - and the forums got me back up and running with the same VM's I had before I blew it up. The backups work great, connects to my FreeNAS server pretty easily and for the simple functionality I require I think it will be fine product to use.
Having said that, I think it ridiculous the hoops you have to jump through just get simple email notifications working. I think many great Linux products tend to push things like this basic functionality off to the OS when they should incorporate it into their package. Out of the gate, this installed product should capable be sending notifications if I give it an email address to send to without me having to configure my server as a relay (Exim, Posfix, or other). Fighting old documentation and a hundred different ways to do it with a Google search.
As far as importing .vmdk files (the original reason for this post), I suppose that's only important to ProxMox developers if they want users to move from VmWare, OpenBox, etc. to their product - which I do not really recall reading about as a "awesome feature" of ProxMox product. On top of that, ProxMox is really just a wrapper/interface for QEMU system - trying to simplify the use of it - I think. The folks at VmWare want you to move to their product and have set up pretty basic ways for you to move your product to theirs. Me personally, I will continue to run VmWare in production and ProxMox at home - when/if I ever get to where I am in need of rebuilding the core virtual servers - I may consider building them on ProxMox server - but trying to move to ProxMox from anything and keep your servers original - after the numerous steps required it is not really something I want to undertake.
This is my fist post on this blog, so I decided to do something simple. Years ago when I switched to using Linux, I started using VirtualBox to test other Linux distros, and to run Window.
VirtualBox is great and easy to use, but the preformance on lower powered machines is not so great. Granted you are running an operating system on top of another operating system (especially a GUI OS) is resource intensive as it is.
About 6 months ago I switched to using qemu/KVM, first with Gnome-Boxes, then Virt-Manager. While Gnome-Boxes has a really nice interface, Virt-Manager allows for more detailed configuration of your virtual machine. So for a while I stuck with Virt-Manager.
All that time I prefered to use command-line tools over GUI tools for just about everything I do. I also hated the overhead another GUI tool creates, especially since running a vm is so heavy anyways.
I really don’t manage virtual-machines on a day to day basis, so I never really rememeber every step on what to do. This post is to not only help you learn how to convert VMDK to qcow2, but give me a reference to look back on.
I personally am running Arch Linux, but qemu/KVM can be installed on any modern Linux distro. One reason I love Arch is the Arch wiki. In my opionin (and many others), there is no better resource for information on Linux, and Linux operating systems.
To install qemu/KVM on Arch Linux go to the qemu in the wiki. There you will see the instructions on what you need to install. To start install:
Once I install qemu I add my user to the “libvirt”, and “kvm” groups
Replace with your actual user name.
You will need to log out and log back in. Or you could run the following commands
Note: This only works for the current instance of your user. This means if you switch users or close your terminal it will revert back. To perminatly change your inclusion into the groups you will need to log out and back in
When building websites, you always want to confirm that all aspects of your site will work on all major browsers. This includes Google Chrome, FireFox, and Internet Explorer/Edge. While the frst 2 are easily installed on Linux, IE/Edge are only available on Windows. But Microsoft has made VirtualBox images availale to test multiple versions of IE and Edge on Linux. Yes I said Microsoft, now pick your jaw off of the floor.
Now open your favorite browser and go to the MS developer site, and download the IE/Edge version of your choice. For the purposes of this tutorial I downloaded the IE11 on Win81.
These are LARGE downloads, this one was 5.3GiB. It took about 30mmin to download.
Once downloaded go to the directory you downloaded it in (most likely ~/Downloads). Now they are downloaded in .zip format so run:
This may take a couple minutes because of how large the file zise is.
Once unzipped you will see a new file in your directory: IE11 — Win8.1.ova. .ova files are just achive files meant to bundle the vmdk file and an ovf file.
ovf files are XML template files VirtualBox uses to easily transfer vm settings
to un-archive the ova file run:
The forward slashes in the above command are space escapes, so your shell knows there is a space in the filename
Now you will see 2 new files in your directory: IE11 — Win8.1-disk1.vmdk, and IE11 — Win8.1.ovf. Finally we found our vmdk file
Since I don’t know of a way to run vmdk files on qemu we need to convert it. Good thing there is a built in conversion tool.
Let’s break that down:
- qemu-img — is the built-in qemu image manipulation tool
- convert — tells qemu-image that you want to convert one image file, such as .img, or in this case .vmdk files
- -f vmdk(optional) — This is an optional command (u could leave it out) qemu can auto-detect. This tells qemu what type of file you are converting from.
- -O qcow2(Uppercase letter O) — This tells qemu what type of file you will convert to.
- IE11\ -\ Win8.1.vmdk — Is the file you are converting from.
- IE11-Win8.1.qcow2(Can be any name you want it) — Is the output file your are converting to.
And that’s it! You should see your new IE11-Win8.1.qcow2 file in your folder. Pretty easy to convert…
This post talks about two software to convert VMDK to QCOW2 in Windows for free. The software I have added here takes a healthy VMDK file from you and produces the corresponding QCOW2 file. The generated QCOW2 files can be used in the dedicated software such as Qemu as a virtual hard drive for the machine. Also, there are other Linux tools that can mount QCOW2 files, you can use it in those as well. However, currently there is no way in Windows to mount them as virtual drives. But you can create QCOW2 files in Windows using a couple of free software that you will see in the post below.
There are quite a number of virtual machine software out there. Some of them are popular and some of them are not. Those virtual machine software use a virtual hard disk file of different formats. The most popular format for the disk of virtual machines are VMDK and VHD but there are some that use other raw formats as well. And one such formats is QCOW2. This format is not supported in Windows and nor you can mount in Windows OS as of now. But you can access its content using free archiver software such as 7-Zip.
If you have a VMDK file and want to use that in another virtual machine that uses QCOW2 format for hard disks then you will have to convert the VMDK file. And the software I have mentioned here lets you do that easily and in just a few minutes. And not only VMDK but the following software can convert the other type of disk images to QCOW2 such as from VHD, VHDX, etc.
Install the virtio drivers and QXL graphics drivers
Install
Open Device Manager
Open device Manager in the control panel or type devmgmt.msc on the command prompt.
Update the drivers
- balloon, the balloon driver affects the PCI device
- vioserial, affects the PCI simple communication controler
- NetKVM, the network driver affects the Network adapters.
- viostor, the block driver affects the Disk drives.
Update the PCI drivers
In windows 10 the PCI device and the PCI Simple Communications Controller have the missing driver icon. Right click on the PCI device and select update driver -> click on Browse my computer for driver software Specify the cdrom as the search location and click Next, this will install the Balloon driver.
Do the same for the PCI Simple Communications Controller this will install the “VirtIO Serial Driver”
install the VioStor driver
Add a temporary disk to the virtual machine and use VirtIO as the Bus Type In the Device Manager you’ll get a new device SCSI Controller right click it and update the driver. This will install the Red Hat VirtIO SCSI controller
Go to the device settings of your virtual machine and change the Disk bus to VirtIO and shutdown you virtual machine.
You can remove the temporary disk now or leave it if you can find some use for it…
Make sure that you disk is selected as the bootable device.
Start the virtual machine and make sure that the system is bootable.
install the netKVM driver
Update the Device model to virtio.
Start devmgmt.msc and update the driver as we did before….
And verify that you network card works correctly.
install the QXL graphical driver
Update the Microsoft Basic Display Adapter
After the installation you can change the the display resolution.
If you want to use higher screen resolutions you need to increase the video ram
Как переместить виртуальную машину VirtualBox на другой ПК?¶
Получим список доступных виртуальных машин VirtualBox:
Экспортируем настройки и данные в открытый формат виртуализации версии 2.0:
Здесь vmname – название виртуальной машины VirtualBox, а vmname.ova – имя файла экспорта.
Переместим полученный файл на новый хост любым удобным способом , затем осуществим его импорт:
Через некоторое время новая виртуальная машина появится в списке и будет готова к работе.
Как правильно установить VirtualBox в Fedora?¶
Сначала нужно подключить репозиторий RPM Fusion , затем выполнить:
Для нормальной работы с USB устройствами и общими папками потребуется также добавить свой аккаунт в группу vboxusers и vboxsf:
Как отключить запрос пароля во время запуска или остановки виртуальных машин при использовании KVM?¶
Возможностью управления виртуальными машинами обладают члены группы libvirt, поэтому нужно добавить в неё свой аккаунт:
merge the vmware disk images…
If you use split disk images on vmware ( or vmware player ) migrate them to a single disk images with the vmware-vdiskmanager command.
Как правильно установить систему виртуализации KVM?¶
Установим KVM и графическую утилиту управления виртуальными машинами virt-manager:
Перезагрузим машину для вступления изменений в силу:
Convert the disk image
Как уменьшить размер дискового образа QCOW2?¶
Уменьшение размера дискового образа QCOW2 при помощи qemu-img – это достаточно небезопасная операция, которая может привести к его повреждению, поэтому вместо отрицательных значений для resize сначала уменьшим размер дисковых разделов внутри самой гостевой ОС при помощи fdisk, Gparted или любого другого редактора разделов диска так, чтобы справа осталось лишь неразмеченное пространство.
Далее воспользуемся утилитой qemu-img и сделаем копию образа, которая уже не будет включать неразмеченное дисковое пространство:
В случае необходимости создания образа фиксированного размера , добавим параметр -o preallocation=full :
Подключим новый образ к виртуальной машине вместо старого и проверим работу. Если всё верно, старый можно удалить.
StarWind V2V Image Converter
StarWind V2V Image Converter is another free software that allows you to painlessly convert a VMDK file to QCOW2 and then you can use that in the virtual machine software that use QCOW format for the virtual disk. This is quite a powerful software that you can use in Windows to convert different type of virtual machine hard disk files to variety of formats including QCOW2. In just a few clicks, you can easily convert a VMDK file to QCOW2 and it even supports the reverse conversion as well. Recently, I uses the same software for VMDK to VHD conversion and now you can use it for VMDK to QCOW2 disk as well.
To download this software on your PC, you will have to fill a short form and enter your email address to get the download link. Next, you install the software and then open it up and its wizard like interface. Actually have to specify the different parameters for the conversion in different steps. In the first form, select the “Local File” option and then give it the path to the source VMDK file.
Now, specify the QCOW2 as the target format and location in your PC where it will save the final QCOW2 file.
Now, you have specified all the parameters and it is time to start the conversion. So, start the conversion process and you can see its progress on its interface. When it fully converts the VMDK file to QCOW2, you can access or use it in the software or other applications that support QCOW2.
In this way, you can use this simple and handy software to easily convert a VMDK file. And not just VMDK but it supports various other kind of virtual hard disk files such as VMDK, VHD, VHDX, etc. Also, you can even use this software to convert an existing hard drive to virtual machine hard disk file.
Как конвертировать динамически расширяющийся образ диска VirtualBox в фиксированный?¶
Динамическая конвертация не поддерживается, поэтому воспользуемся утилитой VBoxManage, входящей в базовую поставку VirtualBox, для создания нового дискового образа на базе старого:
Теперь в свойствах виртуальной машины подключим новый образ фиксированного размера. Старый при этом можно удалить.
import
We need to import the disk image as IDE device since we don’t have the virtio driver in our windows disk image (yet).
Какие дисковые образы лучше: динамически расширяющиеся или фиксированного размера?¶
Фиксированного размера, т.к. они меньше фрагментируются.
Как увеличить размер дискового образа QCOW2?¶
Воспользуемся утилитой qemu-img для увеличения дискового образа:
При использовании образов фиксированного размера , добавим параметр --preallocation=full :
Здесь вместо +10G укажем насколько следует расширить образ. Все операции должны выполняться при остановленной виртуальной машине, в которой он смонтирован.
По окончании, внутри гостевой ОС расширим используемую файловую систему до новых границ образа при помощи fdisk, GParted или любого другого редактора разделов диска.
Import the disk image to KVM
We’ll inport the disk image with virt-install it’s also posible to import the images with virt-manager if you prefer a graphical interface or or just being lazy :-)
Как преобразовать образ виртуальной машины VirtualBox в формат, совместимый с KVM?¶
Для конвертирования образов воспользуемся штатной утилитой qemu-img:
В случае необходимости создания образа фиксированного размера, добавим параметр -o preallocation=full :
Closing Thoughts
QCOW2 is not really a very popular format in the context of virtual machines. And this is why these are the only free software I could find to convert a VMDK file to QCOW2 in Windows. If you are on Linux, there are more advantages for you as you can mount QCOW2 images there easily but this is not the case with Windows. So, if you are looking for some free software to convert VMDK to QCOW2 then you have come to the right place. If you can handle command line tools pretty well then you can use qemu-img. Or, if you want to use simple GUI based software then you can use StarWind V2V Image Converter. And this post will help you in getting started with these free software.
Linux KVM is getting more and more useable for desktop virtualization thanks to the the virtio and QXL/SPICE drivers.
Most Linux distributes have the virtio & QXL drivers you might need to install the spice-vdagent.
On Windows you can download and install the virtio and QXL drivers.
Using the virtio drivers will improve your guest system performance and your virtualization experience.
Как преобразовать образ виртуальной машины VMWare в формат, совместимый с KVM?¶
Вариант 1. Воспользуемся утилитой virt-v2v:
Вариант 2. Воспользуемся утилитой qemu-img:
mount the iso image
Make sure that the cdrom is mounted in windows.
convert the vmdk image to qcow2
Convert the VMDK disk image to qcow2
Available os options
To list the supported operation system you can use the osinfo-query os command
Можно ли использовать KVM на CPU без поддержки аппаратной виртуализации?¶
Нет. KVM требует наличие активной аппаратной виртуализации и при её осутствии работать не будет.
В то же время, без наличия этой функции со стороны CPU, могут работать VirtualBox до версии 6.1.0 и VMWare, хотя и с очень низкой производительностью.
Installation
Можно ли отключить защиту от уязвимостей CPU в гостевых Windows внутри виртуальных машин?¶
Да, согласно MSDN, при помощи следующего REG файла:
Какую систему управления виртуальными машинами лучше установить?¶
Рекомендуется использовать KVM , т.к. её гипервизор и необходимые модули уже находятся в ядре Linux и не вызывают проблем.
Как оптимизировать KVM для работы с SSD-накопителей?¶
Каких-то особых оптимизаций производить не требуется. Достаточно лишь использовать дисковые образы гостевых ОС в формате QCOW2, а также при их подключении указать тип контроллера VirtIO и установить следующие опции:
discard mode: unmap;
detect zeroes: unmap.
Конечно же как в хостовой, так и в гостевой ОС, должна быть включена поддержка TRIM .
Как преобразовать образ виртуальной машины Hyper-V в формат, совместимый с KVM?¶
Для преобразования образа воспользуемся штатной утилитой qemu-img:
Можно ли перенести каталог с образами виртуальных машин KVM?¶
По умолчанию образы создаваемых виртуальных машин создаются в каталоге /var/lib/libvirt/images , что многих не устраивает.
Переместим образы виртуальных машин на отдельный накопитель, смонтированный как /media/foo-bar . ISO будем размещать в каталоге iso , а дисковые образы виртуальных машин – images .
Создаём собственные политики SELinux для указанных каталогов:
Сбросим контекст безопасности SELinux для них:
В настройках Virt Manager добавим новую библиотеку /media/foo-bar/images и зададим её использование для всех виртуальных машин по умолчанию.
qemu-img
qemu-img is a Linux tool but luckily available for Windows as well. This tool comes with a CLI and there is a simple command to convert a VMDK file to QCOW2. It analyzes the given VMDK file and creates the corresponding QCOW2 file that you can use wherever you want. Basically, this tool allows you to convert different kind of virtual hard disk images from one format to other. It supports VMDK, VJD, VHDX, IMG, QCOW2, RAW, and IMG like formats and you can convert them among one another easily, including VMDK to QCOW2. In some Linux distros, you will find this tool pre-installed but in Windows you will have to manually install it.
You can get the Windows binary of this tool from above and then save it somewhere safe. Next, you can add the folder where the binary files of qemu-img are to the system PATH environment variable. If you don’t know what that is then you can see this post. After you’re done with setting the PATH variable, you can start using this tool. Open command prompt or any other CMD emulator and then run this command.
Change the colored parameters in the above command and execute it. It will start processing the input VMDK file after it is done, it will leave the converted QCOW2 file in the same folder. The time it takes for the conversion of the VMDK file depends on its size. In my case, it took around 4 minutes to convert a VMDK of size 2GB to QCOW2. But if you have VMDK of large size, then you will have to be patient during the conversion process.
Что нужно знать о динамически расширяющихся образах?¶
занимают меньше места на диске, постепенно расширяясь до заданного предела.
очень сильно фрагментируются;
производительность значительно уступает образам фиксированного размера .
Как определить имеет ли процессор аппаратную поддержку виртуализации?¶
Проверим наличие флагов vmx (Intel), либо svm (AMD) в выводе /proc/cpuinfo :
Что нужно знать об образах фиксированного размера?¶
практически не фрагментируются, т.к. все блоки для них заранее зарезервированы на диске;
имеют более высокую производительность по сравнению с динамически расширяющимися образами .
занимают очень много места на диске, хотя если файловая система поддерживает разреженные (sparse) файлы, эта функция будет использоваться в полном объёме.
How to Convert VMDK to QCOW2 in Windows?
Как переместить виртуальную машину KVM на другой ПК?¶
Переместим образы дисков из каталога /var/lib/libvirt/images старого хоста на новый любым удобным способом .
Экспортируем конфигурацию виртуальной машины:
Здесь vmname – название машины KVM, а vmname.xml – имя файла, в котором будут сохранены настройки.
Импортируем ранее сохранённую конфигурацию:
Новая виртуальная машина появится в списке и будет готова к работе немедленно.
Get them…
Type of virtio drivers
The following virtio windows drivers are available.
- block (disk drivers)
- network
- baloon ((dynamic memory management)
The fedoraproject provides pre compiled iso images containig all the virtio drivers and installation images for windows XP.
ISO contents
- NetKVM/ - Virtio network driver
- viostor/ - Virtio block driver
- vioscsi/ - Virtio Small Computer System Interface (SCSI) driver
- viorng/ - Virtio RNG driver
- vioser/ - Virtio serial driver
- Balloon/ - Virtio memory balloon driver
- qxl/ - QXL graphics driver for Windows 7 and earlier. (build virtio-win-0.1.103-1 and later)
- qxldod/ - QXL graphics driver for Windows 8 and later. (build virtio-win-0.1.103-2 and later)
- pvpanic/ - QEMU pvpanic device driver (build virtio-win-0.1.103-2 and later)
- guest-agent/ - QEMU Guest Agent 32bit and 64bit MSI installers
- qemupciserial/ - QEMU PCI serial device driver
- *.vfd VFD floppy images for using during install of Windows XP
Download
I use arch linux and download virtio-win AUR package with pacaur. You can download the images directly or use the installation packages for your Linux distribution.
This install virtio images to /usr/share/virtio/
virtio-win.iso is the ISO cdrom image containing all the drivers.
Какой тип QCOW2 образов выбрать?¶
Существует два типа образов:
динамически расширяющийся ;
фиксированного размера .
У каждого есть как достоинства, так и недостатки.
Как создать ярлык запуска виртуальной машины KVM?¶
Для создания ярлыка в главном меню рабочей среды, создадим файл fedora-rawhide.desktop в каталоге ~/.local/share/applications следующего содержания:
Здесь вместо Fedora-Rawhide укажем реальное имя виртуальной машины KVM, а qemu:///session – сеанс, в котором она создана (session – пользовательский; system – системный).
Как правильно установить в KVM Windows?¶
Читайте также: