1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455
|
.\" Automatically generated by Podwrapper::Man 1.28.1 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{
. if \nF \{
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "virt-win-reg 1"
.TH virt-win-reg 1 "2014-10-18" "libguestfs-1.28.1" "Virtualization Support"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "名前"
.IX Header "名前"
virt-win-reg \- Windows 仮想マシンからの Windows レジストリエントリーのエクスポートおよびマージ
.SH "書式"
.IX Header "書式"
.Vb 1
\& virt\-win\-reg domname \*(AqHKLM\ePath\eTo\eSubkey\*(Aq
\&
\& virt\-win\-reg domname \*(AqHKLM\ePath\eTo\eSubkey\*(Aq name
\&
\& virt\-win\-reg domname \*(AqHKLM\ePath\eTo\eSubkey\*(Aq @
\&
\& virt\-win\-reg \-\-merge domname [input.reg ...]
\&
\& virt\-win\-reg [\-\-options] disk.img ... # 仮想マシン名の代わり
.Ve
.SH "警告"
.IX Header "警告"
You must \fInot\fR use \f(CW\*(C`virt\-win\-reg\*(C'\fR with the \fI\-\-merge\fR option on live
virtual machines. If you do this, you \fIwill\fR get irreversible disk
corruption in the \s-1VM. \s0\f(CW\*(C`virt\-win\-reg\*(C'\fR tries to stop you from doing this,
but doesn't catch all cases.
.PP
Modifying the Windows Registry is an inherently risky operation. The format
is deliberately obscure and undocumented, and Registry changes can leave the
system unbootable. Therefore when using the \fI\-\-merge\fR option, make sure
you have a reliable backup first.
.SH "説明"
.IX Header "説明"
このプログラムは Windows 仮想マシンから Windows レジストリのエントリーをエクスポートおよびマージできます。
.PP
第一パラメーターは Windows 仮想マシンの libvirt 仮想マシン名または生のディスクイメージです。
.PP
If \fI\-\-merge\fR is \fInot\fR specified, then the chosen registry key is
displayed/exported (recursively). For example:
.PP
.Vb 1
\& $ virt\-win\-reg Windows7 \*(AqHKEY_LOCAL_MACHINE\eSOFTWARE\eMicrosoft\*(Aq
.Ve
.PP
You can also display single values from within registry keys, for example:
.PP
.Vb 3
\& $ cvkey=\*(AqHKLM\eSOFTWARE\eMicrosoft\eWindows NT\eCurrentVersion\*(Aq
\& $ virt\-win\-reg Windows7 $cvkey ProductName
\& Windows 7 Enterprise
.Ve
.PP
\&\fI\-\-merge\fR を用いると、テキストの regedit ファイルを Windows レジストリーの中に結合できます:
.PP
.Vb 1
\& $ virt\-win\-reg \-\-merge Windows7 changes.reg
.Ve
.SS "注記"
.IX Subsection "注記"
This program is only meant for simple access to the registry. If you want
to do complicated things with the registry, we suggest you download the
Registry hive files from the guest using \fIlibguestfs\fR\|(3) or \fIguestfish\fR\|(1)
and access them locally, eg. using \fIhivex\fR\|(3), \fIhivexsh\fR\|(1) or
\&\fIhivexregedit\fR\|(1).
.SH "オプション"
.IX Header "オプション"
.IP "\fB\-\-help\fR" 4
.IX Item "--help"
簡単なヘルプを表示します。
.IP "\fB\-\-version\fR" 4
.IX Item "--version"
バージョン番号を表示して、終了します。
.IP "\fB\-\-debug\fR" 4
.IX Item "--debug"
デバッグメッセージを有効にします。
.IP "\fB\-c \s-1URI\s0\fR" 4
.IX Item "-c URI"
.PD 0
.IP "\fB\-\-connect \s-1URI\s0\fR" 4
.IX Item "--connect URI"
.PD
libvirt を使用していると、指定された \fI\s-1URI\s0\fR に接続します。 省略すると、デフォルトの libvirt ハイパーバイザーに接続します。
.Sp
仮想マシンのブロックデバイスを直接指定すると、libvirt はまったく使用されません。
.IP "\fB\-\-format\fR raw" 4
.IX Item "--format raw"
Specify the format of disk images given on the command line. If this is
omitted then the format is autodetected from the content of the disk image.
.Sp
If disk images are requested from libvirt, then this program asks libvirt
for this information. In this case, the value of the format parameter is
ignored.
.Sp
If working with untrusted raw-format guest disk images, you should ensure
the format is always specified.
.IP "\fB\-\-merge\fR" 4
.IX Item "--merge"
In merge mode, this merges a textual regedit file into the Windows Registry
of the virtual machine. If this flag is \fInot\fR given then virt-win-reg
displays or exports Registry entries instead.
.Sp
Note that \fI\-\-merge\fR is \fIunsafe\fR to use on live virtual machines, and will
result in disk corruption. However exporting (without this flag) is always
safe.
.IP "\fB\-\-encoding\fR UTF\-16LE|ASCII" 4
.IX Item "--encoding UTF-16LE|ASCII"
When merging (only), you may need to specify the encoding for strings to be
used in the hive file. This is explained in detail in
\&\*(L"\s-1ENCODING STRINGS\*(R"\s0 in \fIWin::Hivex::Regedit\fR\|(3).
.Sp
The default is to use \s-1UTF\-16LE,\s0 which should work with recent versions of
Windows.
.IP "\fB\-\-unsafe\-printable\-strings\fR" 4
.IX Item "--unsafe-printable-strings"
When exporting (only), assume strings are \s-1UTF\-16LE\s0 and print them as strings
instead of hex sequences. Remove the final zero codepoint from strings if
present.
.Sp
This is unsafe and does not preserve the fidelity of strings in the original
Registry for various reasons:
.RS 4
.IP "\(bu" 4
Assumes the original encoding is \s-1UTF\-16LE. ASCII\s0 strings and strings in
other encodings will be corrupted by this transformation.
.IP "\(bu" 4
Assumes that everything which has type 1 or 2 is really a string and that
everything else is not a string, but the type field in real Registries is
not reliable.
.IP "\(bu" 4
Loses information about whether a zero codepoint followed the string in the
Registry or not.
.RE
.RS 4
.Sp
This all happens because the Registry itself contains no information about
how strings are encoded (see \*(L"\s-1ENCODING STRINGS\*(R"\s0 in \fIWin::Hivex::Regedit\fR\|(3)).
.Sp
You should only use this option for quick hacking and debugging of the
Registry contents, and \fInever\fR use it if the output is going to be passed
into another program or stored in another Registry.
.RE
.SH "サポートされるシステム"
.IX Header "サポートされるシステム"
The program currently supports Windows NT-derived guests starting with
Windows \s-1XP\s0 through to at least Windows 8.
.PP
以下のレジストリキーがサポートされます:
.ie n .IP """HKEY_LOCAL_MACHINE\eSAM""" 4
.el .IP "\f(CWHKEY_LOCAL_MACHINE\eSAM\fR" 4
.IX Item "HKEY_LOCAL_MACHINESAM"
.PD 0
.ie n .IP """HKEY_LOCAL_MACHINE\eSECURITY""" 4
.el .IP "\f(CWHKEY_LOCAL_MACHINE\eSECURITY\fR" 4
.IX Item "HKEY_LOCAL_MACHINESECURITY"
.ie n .IP """HKEY_LOCAL_MACHINE\eSOFTWARE""" 4
.el .IP "\f(CWHKEY_LOCAL_MACHINE\eSOFTWARE\fR" 4
.IX Item "HKEY_LOCAL_MACHINESOFTWARE"
.ie n .IP """HKEY_LOCAL_MACHINE\eSYSTEM""" 4
.el .IP "\f(CWHKEY_LOCAL_MACHINE\eSYSTEM\fR" 4
.IX Item "HKEY_LOCAL_MACHINESYSTEM"
.ie n .IP """HKEY_USERS\e.DEFAULT""" 4
.el .IP "\f(CWHKEY_USERS\e.DEFAULT\fR" 4
.IX Item "HKEY_USERS.DEFAULT"
.ie n .IP """HKEY_USERS\e\f(CISID\f(CW""" 4
.el .IP "\f(CWHKEY_USERS\e\f(CISID\f(CW\fR" 4
.IX Item "HKEY_USERSSID"
.PD
ここで \fI\s-1SID\s0\fR は Windows User \s-1SID\s0 です (例: \f(CW\*(C`S\-1\-5\-18\*(C'\fR)。
.ie n .IP """HKEY_USERS\e\f(CIusername\f(CW""" 4
.el .IP "\f(CWHKEY_USERS\e\f(CIusername\f(CW\fR" 4
.IX Item "HKEY_USERSusername"
ここで \fIusername\fR はローカルユーザー名です (これは libguestfs の拡張です)。
.PP
You can use \f(CW\*(C`HKLM\*(C'\fR as a shorthand for \f(CW\*(C`HKEY_LOCAL_MACHINE\*(C'\fR, and \f(CW\*(C`HKU\*(C'\fR for
\&\f(CW\*(C`HKEY_USERS\*(C'\fR.
.PP
The literal keys \f(CW\*(C`HKEY_USERS\e$SID\*(C'\fR and \f(CW\*(C`HKEY_CURRENT_USER\*(C'\fR are not
supported (there is no \*(L"current user\*(R").
.SS "\s-1WINDOWS 8\s0"
.IX Subsection "WINDOWS 8"
Windows 8 \*(L"fast startup\*(R" can prevent virt-win-reg from being able to edit
the Registry. See \*(L"\s-1WINDOWS HIBERNATION AND WINDOWS 8 FAST
STARTUP\*(R"\s0 in \fIguestfs\fR\|(3).
.SH "エンコーディング"
.IX Header "エンコーディング"
\&\f(CW\*(C`virt\-win\-reg\*(C'\fR expects that regedit files have already been reencoded in
the local encoding. Usually on Linux hosts, this means \s-1UTF\-8\s0 with
Unix-style line endings. Since Windows regedit files are often in \s-1UTF\-16LE\s0
with Windows-style line endings, you may need to reencode the whole file
before or after processing.
.PP
To reencode a file from Windows format to Linux (before processing it with
the \fI\-\-merge\fR option), you would do something like this:
.PP
.Vb 1
\& iconv \-f utf\-16le \-t utf\-8 < win.reg | dos2unix > linux.reg
.Ve
.PP
To go in the opposite direction, after exporting and before sending the file
to a Windows user, do something like this:
.PP
.Vb 1
\& unix2dos linux.reg | iconv \-f utf\-8 \-t utf\-16le > win.reg
.Ve
.PP
エンコーディングの詳細は \fIWin::Hivex::Regedit\fR\|(3) を参照してください。
.PP
If you are unsure about the current encoding, use the \fIfile\fR\|(1) command.
Recent versions of Windows regedit.exe produce a \s-1UTF\-16LE\s0 file with
Windows-style (\s-1CRLF\s0) line endings, like this:
.PP
.Vb 3
\& $ file software.reg
\& software.reg: Little\-endian UTF\-16 Unicode text, with very long lines,
\& with CRLF line terminators
.Ve
.PP
This file would need conversion before you could \fI\-\-merge\fR it.
.SH "CurrentControlSet など。"
.IX Header "CurrentControlSet など。"
Registry keys like \f(CW\*(C`CurrentControlSet\*(C'\fR don't really exist in the Windows
Registry at the level of the hive file, and therefore you cannot modify
these.
.PP
\&\f(CW\*(C`CurrentControlSet\*(C'\fR is usually an alias for \f(CW\*(C`ControlSet001\*(C'\fR. In some
circumstances it might refer to another control set. The way to find out is
to look at the \f(CW\*(C`HKLM\eSYSTEM\eSelect\*(C'\fR key:
.PP
.Vb 6
\& # virt\-win\-reg WindowsGuest \*(AqHKLM\eSYSTEM\eSelect\*(Aq
\& [HKEY_LOCAL_MACHINE\eSYSTEM\eSelect]
\& "Current"=dword:00000001
\& "Default"=dword:00000001
\& "Failed"=dword:00000000
\& "LastKnownGood"=dword:00000002
.Ve
.PP
\&\*(L"Current\*(R" is the one which Windows will choose when it boots.
.PP
Similarly, other \f(CW\*(C`Current...\*(C'\fR keys in the path may need to be replaced.
.SH "レジストリーキーおよび値の削除方法"
.IX Header "レジストリーキーおよび値の削除方法"
レジストリキー全体を削除するには、この構文を使用します:
.PP
.Vb 1
\& [\-HKEY_LOCAL_MACHINE\eFoo]
.Ve
.PP
キーにある単一の値を削除するには、この構文を使用します:
.PP
.Vb 2
\& [HKEY_LOCAL_MACHINE\eFoo]
\& "Value"=\-
.Ve
.SH "Windows のヒント"
.IX Header "Windows のヒント"
Note that some of these tips modify the guest disk image. The guest \fImust\fR
be shut off, else you will get disk corruption.
.SS "\s-1RUNNING A BATCH SCRIPT WHEN A USER LOGS IN\s0"
.IX Subsection "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
Prepare a \s-1DOS\s0 batch script, VBScript or executable. Upload this using
\&\fIguestfish\fR\|(1). For this example the script is called \f(CW\*(C`test.bat\*(C'\fR and it
is uploaded into \f(CW\*(C`C:\e\*(C'\fR:
.PP
.Vb 1
\& guestfish \-i \-d WindowsGuest upload test.bat /test.bat
.Ve
.PP
Prepare a regedit file containing the registry change:
.PP
.Vb 4
\& cat > test.reg <<\*(AqEOF\*(Aq
\& [HKLM\eSoftware\eMicrosoft\eWindows\eCurrentVersion\eRunOnce]
\& "Test"="c:\e\etest.bat"
\& EOF
.Ve
.PP
In this example we use the key \f(CW\*(C`RunOnce\*(C'\fR which means that the script will
run precisely once when the first user logs in. If you want it to run every
time a user logs in, replace \f(CW\*(C`RunOnce\*(C'\fR with \f(CW\*(C`Run\*(C'\fR.
.PP
Now update the registry:
.PP
.Vb 1
\& virt\-win\-reg \-\-merge WindowsGuest test.reg
.Ve
.SS "サービスのインストール方法"
.IX Subsection "サービスのインストール方法"
This section assumes you are familiar with Windows services, and you either
have a program which handles the Windows Service Control Protocol directly
or you want to run any program using a service wrapper like SrvAny or the
free RHSrvAny.
.PP
First upload the program and optionally the service wrapper. In this case
the test program is called \f(CW\*(C`test.exe\*(C'\fR and we are using the RHSrvAny
wrapper:
.PP
.Vb 4
\& guestfish \-i \-d WindowsGuest <<EOF
\& upload rhsrvany.exe /rhsrvany.exe
\& upload test.exe /test.exe
\& EOF
.Ve
.PP
Prepare a regedit file containing the registry changes. In this example,
the first registry change is needed for the service itself or the service
wrapper (if used). The second registry change is only needed because I am
using the RHSrvAny service wrapper.
.PP
.Vb 8
\& cat > service.reg <<\*(AqEOF\*(Aq
\& [HKLM\eSYSTEM\eControlSet001\eservices\eRHSrvAny]
\& "Type"=dword:00000010
\& "Start"=dword:00000002
\& "ErrorControl"=dword:00000001
\& "ImagePath"="c:\e\erhsrvany.exe"
\& "DisplayName"="RHSrvAny"
\& "ObjectName"="NetworkService"
\&
\& [HKLM\eSYSTEM\eControlSet001\eservices\eRHSrvAny\eParameters]
\& "CommandLine"="c:\e\etest.exe"
\& "PWD"="c:\e\eTemp"
\& EOF
.Ve
.PP
注:
.IP "\(bu" 4
For use of \f(CW\*(C`ControlSet001\*(C'\fR see the section above in this manual page. You
may need to adjust this according to the control set that is in use by the
guest.
.IP "\(bu" 4
\&\f(CW"ObjectName"\fR controls the privileges that the service will have. An
alternative is \f(CW"ObjectName"="LocalSystem"\fR which would be the most
privileged account.
.IP "\(bu" 4
マジックナンバーの意味は次の Microsoft \s-1KB\s0 記事を参照してください:
http://support.microsoft.com/kb/103000.
.PP
レジストリを更新します:
.PP
.Vb 1
\& virt\-win\-reg \-\-merge WindowsGuest service.reg
.Ve
.SH "SHELL QUOTING"
.IX Header "SHELL QUOTING"
シェルにおいて \f(CW\*(C`\e\*(C'\fR (backslash)
を含むパラメーターを渡すとき、注意する必要があります。通常シェルからそれらを保護するには、'単一引用符' または二つのバックスラッシュ
(しかし、両方ではない) を使用する必要があります。
.PP
パスおよび値の名前は大文字小文字を区別します。
.SH "関連項目"
.IX Header "関連項目"
\&\fIhivex\fR\|(3), \fIhivexsh\fR\|(1), \fIhivexregedit\fR\|(1), \fIguestfs\fR\|(3),
\&\fIguestfish\fR\|(1), \fIvirt\-cat\fR\|(1), \fISys::Guestfs\fR\|(3), \fIWin::Hivex\fR\|(3),
\&\fIWin::Hivex::Regedit\fR\|(3), \fISys::Virt\fR\|(3), http://libguestfs.org/.
.SH "著者"
.IX Header "著者"
Richard W.M. Jones http://people.redhat.com/~rjones/
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (C) 2010 Red Hat Inc.
.SH "LICENSE"
.IX Header "LICENSE"
.SH "BUGS"
.IX Header "BUGS"
To get a list of bugs against libguestfs, use this link:
https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
.PP
To report a new bug against libguestfs, use this link:
https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
.PP
When reporting a bug, please supply:
.IP "\(bu" 4
The version of libguestfs.
.IP "\(bu" 4
Where you got libguestfs (eg. which Linux distro, compiled from source, etc)
.IP "\(bu" 4
Describe the bug accurately and give a way to reproduce it.
.IP "\(bu" 4
Run \fIlibguestfs\-test\-tool\fR\|(1) and paste the \fBcomplete, unedited\fR
output into the bug report.
|