[fedora-virt] modifying per-user registry values?

Richard W.M. Jones rjones at redhat.com
Sat May 14 15:21:24 UTC 2011


On Sat, May 14, 2011 at 09:55:08AM -0400, Tom Horsley wrote:
> I notice that the virt-win-reg tool says it doesn't work with
> HKU/$SID keys, and by golly it doesn't :-).
> 
> Is there a way to modify a users registry in a Windows XP
> image file using some other technique?
> 
> I've got my custom clone script working to modify the
> machine name, but I'd like to also modify the default
> background image, which is in my user's hive.

It's just not implemented yet.  That's because I haven't yet sat down
and worked out how user names are mapped to the user hive files,
across all the different versions of Windows.

However you can just edit the user hive file directly if you know
where it is.

For example with Windows 7 (which works differently from other
versions of Windows, hence the difficulty I mention above):

$ sudo guestfish --ro -i -d Win7x32

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

Operating system: Windows 7 Enterprise
/dev/vda2 mounted on /

><fs> file /Users/rjones/NTUSER.DAT
MS Windows registry file, NT/2000 or above
><fs> download /Users/rjones/NTUSER.DAT /tmp/ntuser.dat
><fs> exit

$ hivexregedit --export /tmp/ntuser.dat \
    '\Software\Microsoft\Windows\CurrentVersion\Explorer' | head
Windows Registry Editor Version 5.00

[\Software\Microsoft\Windows\CurrentVersion\Explorer]
"CleanShutdown"=dword:00000001
"ExplorerStartupTraceRecorded"=dword:00000001
"ShellState"=hex(3):24,00,00,00,30,28,00,00,00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,12,00,00,00,00,00,00,00,22,00,00,00

[\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"AutoCheckSelect"=dword:00000000
"DontPrettyPath"=dword:00000000

You could also edit the hive file (hivexregedit --merge) and upload it
back into the guest.

Patches welcome.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/


More information about the virt mailing list