Modify template Files

AntoWkill

Member
Jul 31, 2013
73
1
6
Hello,
is there a way to edit the files in a template? For example, if i want to edit the file /rc.conf in freebsd when the vm is still offline, only through access to the dedicated server?
 
Hello AntoWkill

I think you mean VM templates rather than CT templates.

The answer is: No!

Note that a template is ready to be the base for one or more linked clones and a change in it´s filesystem can destroy all these dependencies.

Therefore: as soon as a VM is converted to a template it´s HD is read-only.

But what you can do is the following: create a new machine (full clone) based on the existing template - without starting it you can access to it´s HD (see http://blog.loftninjas.org/2008/10/27/mounting-kvm-qcow2-qemu-disk-images/) and change whatever you like. Afterwards you make a new template from it.

Kind regards

Mr.Holmes
 
  • Like
Reactions: bhatmag1ck
Hello AntoWkill

I think you mean VM templates rather than CT templates.

The answer is: No!

Note that a template is ready to be the base for one or more linked clones and a change in it´s filesystem can destroy all these dependencies.

Therefore: as soon as a VM is converted to a template it´s HD is read-only.

But what you can do is the following: create a new machine (full clone) based on the existing template - without starting it you can access to it´s HD (see http://blog.loftninjas.org/2008/10/27/mounting-kvm-qcow2-qemu-disk-images/) and change whatever you like. Afterwards you make a new template from it.

Kind regards

Mr.Holmes

Thanks!! So i can mount qcow2 disk image on dedicated server and acces from the ssh of the dedicated server right?
 
Thanks!! So i can mount qcow2 disk image on dedicated server and acces from the ssh of the dedicated server right?

Yes

Another possibilty seems to be "guestfish" (see new post). I didn´t know it before and don´t know what the advantage is compared with qemu-nbd which is already included in proxmox.
 
Hello AntoWkill

I think you mean VM templates rather than CT templates.

The answer is: No!

Note that a template is ready to be the base for one or more linked clones and a change in it´s filesystem can destroy all these dependencies.

Therefore: as soon as a VM is converted to a template it´s HD is read-only.

But what you can do is the following: create a new machine (full clone) based on the existing template - without starting it you can access to it´s HD (see http://blog.loftninjas.org/2008/10/27/mounting-kvm-qcow2-qemu-disk-images/) and change whatever you like. Afterwards you make a new template from it.

Kind regards

Mr.Holmes


When i try to mount a NFTS disk (Windows) i have an error; mount: unknown filesystem type 'ntfs',
This method does not work with Windows?!
 
When i try to mount a NFTS disk (Windows) i have an error; mount: unknown filesystem type 'ntfs',
This method does not work with Windows?!

For access to ntfs filesystem package ntfs-3g is needed which is not included in standard proxmox installation. After installing it it should work - but I didn´t test it in a proxmox installation yet.
 
For access to ntfs filesystem package ntfs-3g is needed which is not included in standard proxmox installation. After installing it it should work - but I didn´t test it in a proxmox installation yet.
Yes it work perfectly, now i have the same problem for FreeBSD :(
 
Yes it work perfectly, now i have the same problem for FreeBSD :(

You need the proper filesystem driver also in that case. Usually it can be done by

Code:
modprobe ufs

but this kernel module is not available in proxmox, moreover I think that supports only "read-only". Deeper investigation would be necessary.
 
You need the proper filesystem driver also in that case. Usually it can be done by

Code:
modprobe ufs

but this kernel module is not available in proxmox, moreover I think that supports only "read-only". Deeper investigation would be necessary.

modprobe ufs
FATAL: Module ufs not found.

How i can add support for FreeBSD kernel?
 
>Module ufs not found.

It depends on the kernel, which in pve is derived from redhat stable (thus old).
You could try the 3.10 **test** kernel but you could get other side effects, mainly: currently it has no openvz.

one way could be, when you need to edit ufs filesystem resources, to start that vm with a livecd iso which has ufs module support (try #modinfo ufs), if this fits your needs..
then you could mount your "local" ufs disk in the livecd...

Marco
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!