VMware Cloud Community
Schaedle
Enthusiast
Enthusiast
Jump to solution

read configuration file while vm is running

Hi,

is there any way to read a vmx file of a vm while this one is running ? The system is vSphere 5.5

Regards Wolfgang

//edit

Please mention: I want to do this with a running vm. The file is locked and I can't access it.

0 Kudos
1 Solution

Accepted Solutions
gcsc
Enthusiast
Enthusiast
Jump to solution

Browse to the datastore the VM is running in and copy and paste the .vmx into another folder. You should then be able to download it.

View solution in original post

0 Kudos
14 Replies
npadmani
Virtuoso
Virtuoso
Jump to solution

SSH into ESXi host,

navigate to VM folder

vi <vm>.vmx

this should allow you to read it.

Narendra Padmani VCIX6-DCV | VCIX7-CMA | VCI | TOGAF 9 Certified
0 Kudos
pkolom
Enthusiast
Enthusiast
Jump to solution

PowerCli to vcenter/host (connect-vihost)

navigate (cd) to vmstores:vcenter_server\cluster\datastore\vmfolder

get-content filename.vmdk > export_location

Schaedle
Enthusiast
Enthusiast
Jump to solution

Have you every tried it ? This won't work because the file is locked. That's the reason why I wrote while running.

0 Kudos
gcsc
Enthusiast
Enthusiast
Jump to solution

Browse to the datastore the VM is running in and copy and paste the .vmx into another folder. You should then be able to download it.

0 Kudos
npadmani
Virtuoso
Virtuoso
Jump to solution

Yes I have tried it.

Your question is can we read it, yes we can read it the way I have asked you to do.

along with that, you can also modify it if you wish, changes which you are making won't come in effect while VM is running. When you reboot it, all the changes you made in VMX file will be effective.

Narendra Padmani VCIX6-DCV | VCIX7-CMA | VCI | TOGAF 9 Certified
0 Kudos
Schaedle
Enthusiast
Enthusiast
Jump to solution

That's strange I get since years and different versions the same message, when I am connected via ssh to the ESXi:

"server.vmx" Device or resource busy


there is no difference if I try cat, vi, oder cp.


0 Kudos
npadmani
Virtuoso
Virtuoso
Jump to solution

I think you are trying this with <vm>.vmx.lck file

this will give you that message for sure.

Narendra Padmani VCIX6-DCV | VCIX7-CMA | VCI | TOGAF 9 Certified
0 Kudos
Schaedle
Enthusiast
Enthusiast
Jump to solution

Perfect ! This worked. I never thought about the "mouse" version. This would not be a way to automate something, but I helps! Thanks.

0 Kudos
Schaedle
Enthusiast
Enthusiast
Jump to solution

I'm sorry I don't take the lck file.

vmx.jpg

0 Kudos
npadmani
Virtuoso
Virtuoso
Jump to solution

which version ESXi host you are using?

I have taken following from ESXi 6.0

Works for me

Screen Shot 2015-07-15 at 4.57.45 pm.png

I get message like yours if I try that with lck file.

Narendra Padmani VCIX6-DCV | VCIX7-CMA | VCI | TOGAF 9 Certified
0 Kudos
pkolom
Enthusiast
Enthusiast
Jump to solution

Alternatively, you can use your browser to connect to your host, then browse datastores and finally, vmx file you want.

This is working, I tried it.

0 Kudos
Schaedle
Enthusiast
Enthusiast
Jump to solution

Sounds interesting but till now I almost did nothing with PowerCli. I just had a look at this, but it seem's not to be tested in a short time.

0 Kudos
Schaedle
Enthusiast
Enthusiast
Jump to solution

I have version 5.5 and this year we won't upgrade to 6. But good to know it will work with the newest one.

0 Kudos
Schaedle
Enthusiast
Enthusiast
Jump to solution

Thanks! Seems to work. I just was able to copy one vmx file from the datastore via PowerCli.

0 Kudos