Thursday, February 8, 2018

Here is how you move an individual user's profile folder in Windows 7+

In Windows 7 and higher, all users' profile folders (similar to users' home folders in UNIX systems) are located under `C:\Users\` (similar to `/home/`).
There are many articles talking about how you can move the entire "Users" folder to a different drive other than `C:`.

However, it has been hard for me to figure out how to move only one specific user's profile folder out of `C:\Users\` without touching those of other users.
This could be useful when I want to separate the profiles of certain users from the others.
For example, on a lab machine, I want to encrypt the system drive with BitLocker. This will also encrypt the user profile of my own account which is an administrator.
However, at the same time I would like to leave the profiles of some other users (e.g. a customized guest account with persistent settings) unencrypted so they can retrieve their data later from the hard drive without me, even using a different machine.

This is very straight forward in UNIX systems because the home folder location information is part of `/etc/passwd`.

Therefore the first thing that I tried was "Local Users and Groups" in "Computer Management". It appears to be promising -- basically I can find my user in the list of local users:

(Image expired...)

And there are two text-boxes in the user's properties:

(Image expired...)

However, as I annotated in the figure, none of these actually servers the purpose.
If I fill in any or both (yes, I tried all three combinations) of these two text-boxes with the desired path (e.g. `C:\desired\profile\folder\path\`), the next time the target users logs in he receives a warning that Windows could not find his profile folder hence is using a temporary one.
At the same time, an empty folder named with the desired path string plus ".V6" is created (e.g. `C:\desired\profile\folder\path.V6\`), and I have to first gain ownership of that folder before I could delete it.
This does not work even if I have moved the user's original profile folder from `C:\Users\` to that desired path.

Here is what actually works --
The profile path is stored in the system registry in `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-*\ProfileImagePath`. That `S-1-5-*` is the internal user ID associated with the target user which I have to click on each to figure out which is the corresponding one.

(Image expired...)

Note that this key in registry only exists after the target user has logged in successfully for at least once (i.e. its user profile has been created under `C:\Users\`).
After I change the path to the desired path, I also need to use the "Administrator: Command Prompt" (i.e. run "Command Prompt" as Administrator), and move the user's profile folder from `C:\Users\` to the desired path. The syntax is `move SOURCE DESTINATION`, e.g.

move C:\Users\user_name C:\desired\profile\folder\path

As long as the destination is consistent with the one I set earlier in the registry, the migration is successful; the target user will log in with no hassle and use the new profile path from now on.

The complaint here is: Why in the hell does Windows have the two text-boxes in the management console for local users to confuse us?
Possible excuse: It is probably some backward compatible feature. Materials that I found seem to say those boxes are for users whose profiles are located on other machines in the local network.
I do not care though...

Import a VM on VMware ESXi server with vSphere Client 6.0

Okay, so this is the second post in the "funky design" series.
I am writing these down, just in case that I forget about them myself in the future.

With vSphere Client 6.0, creating a VM is relatively easy, just as easy as how you achieve it in VMware Player or VMware Workstation.

(Image expired...)

I would expect importing a VM to be done in the same way, but I was totally wrong on this. I searched the client UI for quite a while but did not find anything related to importing.
What is importing?
After I transfer the files of a VM from one ESXi server to the other, I need to be able to edit it and run it. There needs to be some way to let the new ESXi server know about its existence.

Later I learned this from Google --
First, I need to open the data-store browser by right-click on the data-store in the "summary" page, which is anti-intuition enough...

(Image expired...)

Second, I need to find the file that I copied to this ESXi server, manually select the ".vmx" file, and click the "add to inventory" button.

(Image expired...)

Good job...

Manage permissions of roles on VMware ESXi server with vSphere Client 6.0

First of all, VMware ESXi is at v6.5 at the time this post is composed. However, it seems that VMware has dropped the development of vSphere Client which has been a powerful tool to manage ESXi servers.
Now the latest version of vSphere Client one can get is v6.0 Update 3 (5112508), and the download link can be found in VMware KB: Download URLs for VMware vSphere Client (2089791).

Complaint 1: The web UI shipped with ESXi v6.5 does not work with Chrome (the latest version as of Jan 2018). I get an exception pop-up immediately after I log in. It prevents future interactions and only allows me to reload the log in page which will simply lead to the same exception again. No screen-shot for this because I do not have Chrome on the machine I am currently using, but I believe a lot of you might be using Chrome...

I really think vSphere Client is MUCH MORE stable than the web UI. So sad that they seem to have dropped the development of vSphere Client.
Note that vSphere Client v6.0 can edit the settings of a VM only if the VM was created compatible with v11 or lower.

Complaint 2: If you edit the settings of any virtual machine in the web UI for more than once, including when you create it, the form in the web UI will be filled up with garbage strings and integers (e.g. RAM size becoming some negative number) that you definitely do not want to risk continuing with the edit.

Of course, I totally understand that web-based management systems are much easier to design and maintain. Actually, vSphere Client only works for Windows systems -- those who use macOS or Linux will have to use the web UI or use another VM (to run Windows) to manage the VM host (ESXi server).

Fortunately, I have a Windows 10 machine, so I am still able to run vSphere Client v6.0.
However, I really had a hard time figuring out how to manage users and roles with the client.

(Image expired...)

Management of users and permission can be access in "inventory".
In "users", I can create/delete users;
In "permissions", I can assign roles to the users.
But wait -- how do I manage the roles?

I searched Google and here is what I found:
First, I need to go back to the "home" page which I do not even know about its existence before this; then click on "roles".

(Image expired...)

On the "roles" page, I can then add and edit roles if I have enough permissions to do so.

(Image expired...)

Complaint 3: I know this does not sound very complicated, but it is really anti-intuition to me, i.e. why this function is so far away from other related functions in the client software. I do not quite understand the thoughts of who designed this client. Honestly, I think some times it could be very helpful if the entrance of some function of the software appears multiple times in different places, so it is easier to find.

Anyway, more complaints are coming in the next post.

Think twice before you buy the Edimax EW-7811Un dongle

This is just a complaint...
I think everyone who is thinking of buying a tiny Wi-Fi dongle should really think twice, especially those who is planning to use it on a Linux machine.

Edimax EW-7811Un
During the past three years working with it I got mostly just headaches.
It is slow (approximately 20 Mbps in my case) and it creates a lot of compatibility issues with the built-in Wi-Fi driver of Raspbian, Ubuntu 14.04 LTS, Ubuntu 16.04 LTS, and CentOS 7.

You are worth a better dongle.