I recently received the following question: "How do you install and use BitLocker on Hyper-V Server". Of course when I read the question, I thought, "That's easy", and then I started thinking about the process. One of the struggles with a GUI-less server is that the GUI tools no longer work. To compensate for the lack of a GUI, command line tools are the way to get it done. Now I remember why people love the GUI interface! I've highlighted all of the commands I used below. I've also created a second blog post that includes a lot of the material I referenced to assemble this information.
Installing and configuring BitLocker is not hard, but I did have to hunt to find the right way to install it for Hyper-V Server. The same process should work for Server Core. The full install of Server 2008 and your Vista installations should be able to use this process if you want to automate the deployment.
Remember the BitLocker drive preparation tool? I could not get it to work on Hyper-V server, so I had to manually configure my hard drive. Check out the BitLocker Drive Encryption Step-by-Step Guide. Just follow Scenario 1 for Hyper-V Server to partition the drive properly. You should also check out my earlier blog on BitLocker. I talk about the environmental considerations in an AD forest to ensure that your recovery key gets escrowed properly.
Once the hard drive is properly configured and Hyper-V Server is installed, now you need to install the BitLocker feature on the Hyper-V Server. Here's the command to accomplish the installation:
ocsetup BitLocker
Once BitLocker is installed, you need to reboot the machine. Hang in there, we'll be rebooting the machine a few times to get this installed and configured. While we've eliminated a lot of reboots, we didn't eliminate any in this process. The good news is that you only need to do this once per machine.
Once you install BitLocker, you'll now have access to manage-bde.wsf. This is the tool that will let you manage BitLocker on your Hyper-V Server. This is a very powerful script and it contains a lot of options. I'm highlighting just the options we need to configure BitLocker.
You now need to take ownership of the TPM chip. There can only be one owner, so if you are dual booting, you can only use BitLocker on one of the OS'.
CScript Manage-bde.wsf -tpm -TurnOn
Now, you need to reboot your computer and follow the startup instructions.
the shutdown command is:
shutdown /r /t 0 <-- The /r will cause the computer to reboot, the "/t 0" says that the time to wait before rebooting is zero seconds.
At this point, the TPM chip is now ready to be "paired to" your individual installation of Hyper-V Server.
The command below pairs your installation to the TPM chip.
CScript Manage-bde.wsf -tpm -TakeOwnership 12345678 <-- The "12345678" is the test password to ensure that you can use a password.
Now that your installation "owns" the TPM chip, now all we have to do is turn on BitLocker and tell it to encrypt your drive.
Here is the command we'll use to start the encryption process:
cscript manage-bde.wsf -on c: -tp 1234 -rp
The parameters from the command above are as follows:
-on <-- enables BitLocker
-tp <-- Tells BitLocker to use the TPM chip and a PIN.
1234 <-- The PIN used for the TPM chip
-rp <-- Requests a Recovery Password
Here is the output from the cscript manage-bde.wsf -on c: -tp 1234 -rp command:
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Volume C:
[OS Volume]
Key Protectors Added:
Numerical Password:
ID: {A438547B-91C3-4DC8-B68D-619FD4C02E25}
Password:
584012-604868-288761-377025-269291-127160-526251-320551
TPM And PIN:
ID: {89054F39-A10E-4E09-93C1-73FA31EFCB20}
ACTIONS REQUIRED:
1. Save this numerical recovery password in a secure location away from
your computer:
584012-604868-288761-377025-269291-127160-526251-320551
To prevent data loss, save this password immediately. This password helps
ensure that you can unlock the encrypted volume.
2. Restart the computer to run a hardware test.
(Type "shutdown /?" for command line instructions.)
3. Type "manage-bde -status" to check if the hardware test succeeded.
NOTE: Encryption will begin after the hardware test succeeds.
Now take note that while we've turned BitLocker on, the encryption has not started yet. Check out the section in red above.
Before you reboot your machine, please ensure that you record your BitLocker recovery password. In my example, my recovery password is 584012-604868-288761-377025-269291-127160-526251-320551. This password MUST be kept secret. Anyone that has access to your unique password has the ability to access the contents of your encrypted drives. I configured my demo machine with Hyper-V Server and BitLocker as I wrote this article. I'm sharing my actual recovery keys because I rebuild this machine all the time and I do not keep any confidential information on it. I expect that I'll have my machine reconfigured within a week or two, so this BitLocker password will not be of any used to anyone. Your BitLocker recovery password on the other hand, must be kept secure. My earlier blog, that I referenced above, discusses how to configure AD to automatically record the BitLocker recovery key before a hard drive can be encrypted.
Back to our latest command: Before BitLocker actually starts encrypting your hard drive, it wants you to reboot your machine to ensure that the BitLocker boot process works properly.
You do have the option to add the "-SkipHardwareTest" to immediately start the encryption process, but I recommend against this option unless you've already successfully tested this hardware with BitLocker. Please do not just add this option to expedite the installation process. If you do and your machine is not properly configured, you could end up with an encrypted drive that is unusable and will need to be reformatted.
Now we are ready to reboot the machine and start the hardware test. The hardware test isn't much more than just a reboot of the machine to ensure that the new configuration works properly before the encryption process begins.
To reboot your machine again:
shutdown /r /t 0
If all goes well, when the machine reboots, it will prompt you for the PIN we entered above. In my example, my PIN was "1234". Once the PIN is entered, Hyper-V Server will continue the boot process and then encrypt your drive.
You can use
CScript manage-bde.wsf -status
to track the encryption process so that you'll know when the encryption is complete. The encryption process is pretty fast, it should be finished in an hour or two.
This is the basic BitLocker configuration process. I agree that it's not a simple one or two command process, but the value of BitLocker is that the encryption is unique to your machine and your instance of Hyper-V Server. This is one of the things that makes BitLocker as secure as it is.
I'll add another post with some additional BitLocker reference material that would be worth reviewing before you try to deploy BitLocker in a production environment.
Until next time,
Rob!