kvm running loop device as boot disk

bardiamgtgc

New Member
Credits
86
hey
im trying to run a windows server vm on an ntfs partition as my ssd is almost full and i dont want to have the vm on my own ssd and on my nas all my drives are ntfs

first i tried to have the qcow2 file exactly on my network ntfs partition which failed and after some looking around no luck with that then according to this article i can mount my image as a loop device https://opensos.blogspot.com/2013/06/using-kvm-disk-image-on-ntfs-partition.html i decided to mount the qcow2 image then use it in kvm which also failed when running kpartx -a -v myimage.qcow2 i get an error about ntfs signatures

so i converted the qcow2 to a raw image format and i was able to mount it

now i have /dev/loop31p1 /dev/loop31p2 /dev/loop31p3 (p1 is windows bootloader, p2 is windows filesystem itself, p3 is recovery im guessing because it only has a Recovery directory inside it)

now i have no idea how to get them to work inside kvm first i tried adding them as different disks but it failed and im guessing it failed because it couldnt recognize which disk has the bootloader and which one is the filesystem(stuck at booting from hard drive)

also if this helps with anything, this vm came from one of my servers running vmware esxi then converted to qcow2 then to raw i can do a clean install if needed there isnt much data on this image

im running ubuntu 20.04 trying to run intel gvt-g which works fine on my ssd but as i said im running out of space

any solutions to this?
 


f33dm3bits

Gold Member
Gold Supporter
Credits
24,603
Why are you using a none-native filesystem(ntfs) on Linux for your data, that's not very smart to do. Since you are running Ubuntu setup an nfs share so that your nas can access and mount it locally than point your kvm storage pool to that directory. Although I'm not sure if nfs supports ntfs, bad choice of filesystem for running Linux. I have never tried using a loopback device in KVM, however I would think the only way to add a loop back device to your KVM storage pool would be to create a new storage pool with type:
Code:
"fs:Pre-Formatted Block  Device"
 

bardiamgtgc

New Member
Credits
86
thanks for responding
i have been a linux system administrator for a long time and i had windows and a linux vm for a long time because i was also a .net programmer which i dont code in .net anymore and i use flutter and python
been about 9 months that i installed linux and completely removed windows because i didnt need windows anymore and even for gaming linux has me covered(90%)
but i cant just wipe all my drives and reformat to ext4 first cause i dont have the time and secondly because i dont even have the effort to do it
will try your solution even tho i have never really used kvm and im a long time vmware and virtualbox user will search it up and give it a try
thanks
 

Condobloke

Well-Known Member
Credits
15,143

bardiamgtgc

New Member
Credits
86
Why are you using a none-native filesystem(ntfs) on Linux for your data, that's not very smart to do. Since you are running Ubuntu setup an nfs share so that your nas can access and mount it locally than point your kvm storage pool to that directory. Although I'm not sure if nfs supports ntfs, bad choice of filesystem for running Linux. I have never tried using a loopback device in KVM, however I would think the only way to add a loop back device to your KVM storage pool would be to create a new storage pool with type:
Code:
"fs:Pre-Formatted Block  Device"
so while testing out your solution it looks like i can only use 1/3 partitions which isnt suitable
 

f33dm3bits

Gold Member
Gold Supporter
Credits
24,603
The only other option you could try which I already mentioned is creating an nfs share and sharing that to your nas so that you can use that location as a directory storage pool but that would require you use qcow2 as vm images. You are the first Linux system administrator I have come across that prefers using ntfs on Linux over a native Linux file-system, why is that just out of curiosity?
 

bardiamgtgc

New Member
Credits
86
The only other option you could try which I already mentioned is creating an nfs share and sharing that to your nas so that you can use that location as a directory storage pool but that would require you use qcow2 as vm images. You are the first Linux system administrator I have come across that prefers using ntfs on Linux over a native Linux file-system, why is that just out of curiosity?
will try network file system solution

i actually dont prefer ntfs its just that i have my data on ntfs and i dont want to wipe it all off and i also dont have any backup drives to tranfer files onto temporarily
when i can get my hands on some newer 4tb drives i will transfer all my files to a native linux filesystem and wipe my old drives but right now i have no choice
 

f33dm3bits

Gold Member
Gold Supporter
Credits
24,603
Last edited:
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Latest posts

Top