Citrix Provisioning Services Reverse Imaging – 2017 edition

Citrix Provisioning Services Reverse Imaging – 2017 edition

2017-08-02
/ /
in Blog
/

We’ve been trying to upgrade our Citrix PVS tools to version 7.13 and had some issues.  I need to reverse image so I can remove the software without dealing with the in-place upgrade procedure. So I decided this would be a good time to update my reverse imaging process.  This time I will only be using native tools built into the OS.  With that, this is my new procedure for reverse imaging.  It’s much faster and easier than my last process, but it does have a dependency.  You must be running Windows 2012 or greater so that dism.exe is a part of the OS.  This reverse imaging process is VMWare specific but the principals should apply to all hypervisors.  The overview of the process is as follows:
Create a local hard drive on a ‘build’ server that your vDisk will be based off of.
Attach that disk to the PVS server
Image vDisk to local disk
Boot local disk, manipulate as needed
Image local disk back

  1. Create a new hard disk on your ‘build’ VM that we will use as the staging for the vDisk you want to reimage
  2. Attach the newly created disk to your PVS server
  3. Setup the disks on the PVS server.  In my example, the G: drive is a mounted VHDX of the Citrix vDisk.  I’m using DISM to capture an image file of this disk to a wim that I will apply to the local disk created in step 1.  You will need to create a partition on the disk you made in step 1 and set it as active (if this is a MBR disk).  Unfortunately, DISM does not do disk to disk imaging so this intermediary step is required.  In my video here, the E: drive is the local disk that belongs to my target ‘build’ server.  In addition, you must fix the BCD store as it will point to the original partition, not your new target partition.
    The BCD commands are:

    You will need to replace “partition=E:” with your drive letter of the LOCAL disk.

  4. Remove your hard disk from the PVS virtual machine without deleting it.  Ensure the disk is attached to your BUILD target device.  If you are booting up your BUILD target device from an ISO or PXE you may need to disable those features so that it boots from the hard disk.  I also disconnect the network from the virtual machine because we will need to reset the computer account with AD.
  5. To reset the computer account with AD, you need to login to the system.  The easiest method is if you know the local administrator password, log in with that and “rejoin” the domain.  If not, disconnect the network then logon with an account that has recently logged onto the server.  Cached credentials should be able to pass you through.  Once you are in, connect the network and rejoin the domain.  You can typically “rejoin” by changing the domain name to the NETBIOS name, or the reverse if the NETBIOS name is present

    At this point you can do whatever work is required.

  6. Once you are done with whatever work you need to do, set the target device to boot from hard disk, but keep your vDisk set as an option.  This will attach the vDisk on boot as a secondary drive.  This will allow us to image back to it.  You need to ensure this vDisk is in PRIVATE mode OR has a Maintenance version.  This will set the vDisk to a Read/Write mode.

    If you have your WRITE drive attached, you will need to ensure your local system disk is the LAST disk in the order for your VM.  The PVS boot loader, when set to boot from hard disk, seems to try and boot the LAST disk it detects.


    Checking the PVS Status Tray shows you’ve booted from a local hard drive.


    Something you will need to check and validate is that the Hard Disk of the Citrix vDisk is NOT the drive letter of your write cache (if you find you cannot attach a write cache).  The reason is you have probably redirected the page file, event logs or whatever and if the Citrix vDisk occupies that drive letter you will not be able to image to it because it will be in use.
  7. To image back open the Imaging Wizard:

    And go through the imaging process.

    I prefer to image to the vDisk volume (as seen in this process).

  8. Done!  Set the device to boot via the vDisk as opposed to Hard Disk, delete the local OS disk, boot up your vDisk and run any scripts to ‘finalize’ your image.

Post a Comment

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

*