VMware – Recovering a deleted/lost .vmx file

>To recreate a deleted or lost .vmx file, follow the below steps:

1. Log into the ESX host as root.
2. Browse to the data store where the VM is residing.
3. Open the vmware.log file (cat vmware.log grep less).
4. Search for DICT entries in the file, these entries list the preferred setting and list which .vmx file was used.
5. Go to the section ‘configuration’ as highlighted below.
6. All entries between the ‘Configuration and ‘USER DEFAULTS’ section is part of VMX file.
7. Copy all the entries in this section to file and remove the time stamps in front of the line.
Dec 23 01:44:07.360: vmx DICT — COMMAND LINE
Dec 23 01:44:07.360: vmx DICT sched.group = host/user
Dec 23 01:44:07.360: vmx DICT — CONFIGURATION
Dec 23 01:44:07.360: vmx DICT config.version = 8
Dec 23 01:44:07.360: vmx DICT virtualHW.version = 4
Dec 23 01:44:07.360: vmx DICT floppy0.present = FALSE
Dec 23 01:44:07.360: vmx DICT nvram = Mail.nvram
Dec 23 01:44:07.360: vmx DICT powerType.powerOff = default
Dec 23 01:44:07.360: vmx DICT powerType.powerOn = default
Dec 23 01:44:07.360: vmx DICT powerType.suspend = default
Dec 23 01:44:07.360: vmx DICT powerType.reset = default
Dec 23 01:44:07.360: vmx DICT displayName = Mail
Dec 23 01:44:07.360: vmx DICT extendedConfigFile = Mail.vmxf
Dec 23 01:44:07.360: vmx DICT scsi0.present = TRUE
Dec 23 01:44:07.360: vmx DICT scsi0.sharedBus = none
Dec 23 01:44:07.360: vmx DICT memsize = 2048
Dec 23 01:44:07.360: vmx DICT scsi0:0.present = TRUE
Dec 23 01:44:07.360: vmx DICT scsi0:0.fileName = Mail-000002.vmdk
Dec 23 01:44:07.360: vmx DICT scsi0:0.deviceType = scsi-hardDisk
Dec 23 01:44:07.360: vmx DICT ide0:0.present = TRUE
Dec 23 01:44:07.360: vmx DICT ide0:0.fileName = /vmimages/ISO/windows 2003 r2 disk1.iso
Dec 23 01:44:07.360: vmx DICT ide0:0.deviceType = cdrom-image
Dec 23 01:44:07.360: vmx DICT floppy0.fileName = /dev/fd0
Dec 23 01:44:07.360: vmx DICT ethernet0.present = TRUE
Dec 23 01:44:07.360: vmx DICT ethernet0.startConnected = TRUE
Dec 23 01:44:07.360: vmx DICT ethernet0.wakeOnPcktRcv = FALSE
Dec 23 01:44:07.360: vmx DICT ethernet0.networkName = VM Network
Dec 23 01:44:07.360: vmx DICT ethernet0.addressType = generated
Dec 23 01:44:07.360: vmx DICT ethernet1.present = TRUE
Dec 23 01:44:07.360: vmx DICT ethernet1.startConnected = TRUE
Dec 23 01:44:07.360: vmx DICT ethernet1.wakeOnPcktRcv = FALSE
Dec 23 01:44:07.360: vmx DICT ethernet1.networkName = iSCSI
Dec 23 01:44:07.360: vmx DICT ethernet1.addressType = generated
Dec 23 01:44:07.360: vmx DICT usb.present = FALSE
Dec 23 01:44:07.360: vmx DICT serial0.present = FALSE
Dec 23 01:44:07.360: vmx DICT serial0.yieldOnMsrRead = true
Dec 23 01:44:07.360: vmx DICT serial0.fileName = /dev/ttyS0
Dec 23 01:44:07.360: vmx DICT serial1.present = FALSE
Dec 23 01:44:07.360: vmx DICT serial0.present = FALSE
Dec 23 01:44:07.360: vmx DICT serial0.yieldOnMsrRead = true
Dec 23 01:44:07.360: vmx DICT serial0.fileName = /dev/ttyS0
Dec 23 01:44:07.360: vmx DICT serial1.present = FALSE
Dec 23 01:44:07.360: vmx DICT serial1.yieldOnMsrRead = true
Dec 23 01:44:07.360: vmx DICT serial1.fileName = /dev/ttyS1
Dec 23 01:44:07.360: vmx DICT parallel0.present = FALSE
Dec 23 01:44:07.360: vmx DICT parallel0.fileName = /dev/parport0
Dec 23 01:44:07.360: vmx DICT parallel0.bidirectional = false
Dec 23 01:44:07.360: vmx DICT guestOS = win2000serv
Dec 23 01:44:07.360: vmx DICT sched.cpu.affinity = all
Dec 23 01:44:07.360: vmx DICT sched.mem.affinity = all
Dec 23 01:44:07.360: vmx DICT scsi0:0.redo =
Dec 23 01:44:07.360: vmx DICT ethernet0.generatedAddress = 00:0c:29:5c:71:db
Dec 23 01:44:07.360: vmx DICT ethernet1.generatedAddress = 00:0c:29:5c:71:e5
Dec 23 01:44:07.360: vmx DICT uuid.location = 56 4d 25 c0 c5 3e 01 fc-c6 87 49 2a b9 5c 71 db
Dec 23 01:44:07.360: vmx DICT uuid.bios = 56 4d 25 c0 c5 3e 01 fc-c6 87 49 2a b9 5c 71 db
Dec 23 01:44:07.360: vmx DICT sched.swap.derivedName = /vmfs/volumes/b4a92836-f7c59acd/Mail/Mail-7de70e31.vswp
Dec 23 01:44:07.360: vmx DICT ethernet0.generatedAddressOffset = 0
Dec 23 01:44:07.360: vmx DICT ethernet1.generatedAddressOffset = 10
Dec 23 01:44:07.360: vmx DICT tools.syncTime = FALSE
Dec 23 01:44:07.360: vmx DICT checkpoint.vmState.readOnly = FALSE
Dec 23 01:44:07.360: vmx DICT checkpoint.vmState =
Dec 23 01:44:07.360: vmx DICT scsi0:1.present = FALSE
Dec 23 01:44:07.360: vmx DICT scsi0:1.fileName = Mail_1.vmdk
Dec 23 01:44:07.360: vmx DICT scsi0:1.deviceType = scsi-hardDisk
Dec 23 01:44:07.360: vmx DICT scsi0:1.redo =
Dec 23 01:44:07.360: vmx DICT ide0:0.startConnected = TRUE
Dec 23 01:44:07.360: vmx DICT — USER DEFAULTS
Dec 23 01:44:07.360: vmx DICT — HOST DEFAULTS
Dec 23 01:44:07.360: vmx DICT libdir = /usr/lib/vmware
Dec 23 01:44:07.360: vmx DICT authd.fullpath = /usr/sbin/vmware-authd
Dec 23 01:44:07.360: vmx DICT authd.client.port = 902

After removing the time stamp the file should look like (warp the arguments in quotes):
config.version = “8”
virtualHW.version = “4”
floppy0.present = “false”
nvram = “Mail.nvram”
powerType.powerOff = “default”
powerType.powerOn = “default”
powerType.suspend = “default”
powerType.reset = “default”

displayName = “Mail”
extendedConfigFile = “Mail.vmxf”

scsi0.present = “true”
scsi0.sharedBus = “none”
memsize = “2048”
scsi0:0.present = “true”
scsi0:0.fileName = “Mail-000002.vmdk”
scsi0:0.deviceType = “scsi-hardDisk”
ide0:0.present = “true”
ide0:0.fileName = “/vmimages/ISO/windows 2003 r2 disk1.iso”

ide0:0.deviceType = “cdrom-image”
floppy0.fileName = “/dev/fd0”
ethernet0.present = “true”
ethernet0.startConnected = “true”
ethernet0.wakeOnPcktRcv = “false”
ethernet0.networkName = “VM Network”
ethernet0.addressType = “generated”
ethernet1.present = “true”
ethernet1.startConnected = “true”
ethernet1.wakeOnPcktRcv = “false”
ethernet1.networkName = “iSCSI”
ethernet1.addressType = “generated”
usb.present = “false”
serial0.present = “false”
serial0.yieldOnMsrRead = “true”
serial0.fileName = “/dev/ttyS0”
serial1.present = “false”
serial1.yieldOnMsrRead = “true”
serial1.fileName = “/dev/ttyS1”
parallel0.present = “false”
parallel0.fileName = “/dev/parport0”
parallel0.bidirectional = “false”
guestOS = “win2000serv”
sched.cpu.affinity = “all”
sched.mem.affinity = “all”

scsi0:0.redo = “”
ethernet0.generatedAddress = “00:0c:29:5c:71:db”
ethernet1.generatedAddress = “00:0c:29:5c:71:e5”
uuid.location = “56 4d 25 c0 c5 3e 01 fc-c6 87 49 2a b9 5c 71 db”
uuid.bios = “56 4d 25 c0 c5 3e 01 fc-c6 87 49 2a b9 5c 71 db”
sched.swap.derivedName = “/vmfs/volumes/b4a92836-f7c59acd/Mail/Mail-7de70e31.vswp”
ethernet0.generatedAddressOffset = “0”
ethernet1.generatedAddressOffset = “10”
tools.syncTime = “FALSE”

checkpoint.vmState.readOnly = “FALSE”
checkpoint.vmState = “”

scsi0:1.present = “false”
scsi0:1.fileName = “Mail_1.vmdk”
scsi0:1.deviceType = “scsi-hardDisk”
scsi0:1.redo = “”

ide0:0.startConnected = “true”

Advertisements

3 thoughts on “VMware – Recovering a deleted/lost .vmx file

  1. Janaye November 17, 2011 at 4:23 pm Reply

    That addresses several of my cconrnes actually.

    • Latrice December 1, 2011 at 3:42 pm Reply

      You have shed a ray of sushinne into the forum. Thanks!

    • Caelii December 3, 2011 at 7:51 am Reply

      Nothing I could say would give you undue criedt for this story.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: