Bobcares

Add QCOW2 to proxmox

by | Feb 1, 2023

Wondering how to add qcow2 to proxmox? Our in-house experts are here to help you out with this article. Our proxmox support is here to offer a lending hand with your queries and issues.

How to Add QCOW2 to proxmox?

Today, let us see the steps followed by our support techs to add QCOW2.

1. import Qcow2 image to the Proxmox server.

You could import the qcow2 file to any directory. I will move the qcow2 image to the Proxmox server directory –/var/lib/vz/template/qemu

Using the SCP command from KVM, I have transferred the file.

scp ubuntu.qcow2    root@10.1.40.10:/var/lib/vz/template/qemu

If you don’t have direct SCP access, you could transfer the file using Filezilla or WinSCP softwares.

As you can see, the Ubuntu.qcow2 image is now available in the directory, with a size of 21GB.

2. Create a VM without OS.

Let’s go ahead and create a virtual machine in Proxmox without specifying the os.

Click on create VM.

In the general properties;

Node: Specify the node.
VM ID: It will be auto-created.
Name: Provide a meaningful name.

OS configuration.

In the OS configuration, by default, it would choose Use CD/DVD disk image file (iso)
We are not specifying the OS now, hence choose Do not use any media.

Guest OS:

Based on what operating system you are going to install, you need to choose the type and the version.

Since I am installing Ubuntu which is based on Linux, I choose Linux and the version as 5.x

Leave system settings to default and click on Next.

Add/Remove the virtual hard disk.

There will be a default hard disk created with 32GB of storage by default in the virtual hard disk selection. If you have enough storage on the qcow2 image, you don’t need to add this virtual hard disk. Since I require more storage, I will keep the entire 32 GB.

Change the Bus/Device to VirtIOBlock.

Depending on your storage requirement, you may increase, decrease, or even remove the storage here.

After adding the qcow2 image, you will have two virtual hard disks. The first one you are adding here, and the second one is the qcow2 image that we import.

Configure CPU.

Configure the CPU based on the operating system requirement.

I am providing 2 CPUs.

Memory configuration.

Finally, the required memory depends on your operating system. You may provide the recommended memory size and click on next.

Choose your network and click on next.

You will see the new virtual machine created with ID 107.

3. Import the qcow2 image to the virtual machine in Proxmox.

We will now import the qcow2 image as the virtual hard disk for Proxmox.

Login to the Proxmox CLI and switch to the qcow2 image directory we imported.

root@prxmx-ve-01:/# cd /var/lib/vz/template/qemu/
root@prxmx-ve-01:/var/lib/vz/template/qemu# pwd
/var/lib/vz/template/qemu
root@prxmx-ve-01:/var/lib/vz/template/qemu# ls -l -h
total 21G
-rw------- 1 root root 21G Apr  1 22:38 ubuntu.qcow2
root@prxmx-ve-01:/var/lib/vz/template/qemu#

Issue the below command to import the qcow2 virtual hard disk to the newly created virtual machine.

qm importdisk 107 ubuntu.qcow2 local-lvm

Tip: You can use the tab key while entering the command. For example, after importing the disk, when I hit the tab, I could see all the VMIDs present in Proxmox.

This import virtual hard disk will take time depending on the size of the qcow2 image.

root@prxmx-ve-01:/var/lib/vz/template/qemu# qm importdisk 107 ubuntu.qcow2 local-lvm
importing disk 'ubuntu.qcow2' to VM 107 ...
  Logical volume "vm-107-disk-1" created.
transferred 0.0 B of 20.0 GiB (0.00%)
transferred 206.8 MiB of 20.0 GiB (1.01%)
transferred 411.6 MiB of 20.0 GiB (2.01%)
.
.
.
transferred 19.9 GiB of 20.0 GiB (99.58%)
transferred 20.0 GiB of 20.0 GiB (100.00%)
transferred 20.0 GiB of 20.0 GiB (100.00%)
Successfully imported disk as 'unused0:local-lvm:vm-107-disk-1'
root@prxmx-ve-01:/var/lib/vz/template/qemu#

4. Attach the newly added virtual hard disk to the VM.

Although you can make the changes on the CLI, we will make the following changes in the GUI.

Login to the Proxmox server web GUI.

Select the virtual machine created in step2.

Click on Hardware

You will see the newly imported qcow2 image as Unused disk 0.

Double click on th

You will get a pop-up to add the new virtual hard disk.

It has picked up SCSI as the Bus/Device type by default. We need to change it to VirtIO block to get better performance.

Rest all, leave it to default and click on Add.

You will see a new hard disk has been added with a volume of 20GB alongside the first virtual hard disk.

In my case, I defined 20GB storage in the KVM, the same has carried over to the Proxmox, which should be good.

5. Change the Boot Order.

For the Proxmox to start booting from the newly added qcow2 to storage, we need to define it in the boot order.

Select the Virtual machine -> Options-> Select the boot order and click on Edit.

Change from the default order to the following.

The new virtual hard disk should be the primary boot device, select the newly added virtual hard disk virtio1 and click on the hamburger icon to drag to the top and click on Ok.

6. Boot the VM from the Imported QCOW2 image.

You may go ahead and select the virtual machine and click on Console and start the VM.

We have successfully booted into the Ubuntu machine, which we imported from the KVM using the qcow2 image.

[Looking for a solution to another query? We’re happy to help.]

Conclusion

In this article, we provide a quick and simple solution from our Support team to add qcow2 to proxmox

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF