[KVM-AUTOTEST PATCH 2/7] KVM test: Batch script that prepares a Windows guest for remote access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



setuprss.bat copies rss.exe to C:\, makes it run at startup, disables the
firewall, sets a known password for the administrator account, makes it logon
automatically, and does some Vista/2008 specific things.

The script requires administrator privileges.

Usage: setuprss.bat [full path to executable]
e.g.: setuptrss.bat D:\rss.exe

If used without parameters, rss.exe will be copied from the directory in which
setuprss.bat resides.

Signed-off-by: Michael Goldish <mgoldish@xxxxxxxxxx>
---
 client/tests/kvm/deps/rss.reg      |   15 +++++++++++++++
 client/tests/kvm/deps/setuprss.bat |   19 +++++++++++++++++++
 2 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100644 client/tests/kvm/deps/rss.reg
 create mode 100644 client/tests/kvm/deps/setuprss.bat

diff --git a/client/tests/kvm/deps/rss.reg b/client/tests/kvm/deps/rss.reg
new file mode 100644
index 0000000..b285d40
--- /dev/null
+++ b/client/tests/kvm/deps/rss.reg
@@ -0,0 +1,15 @@
+Windows Registry Editor Version 5.00
+
+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
+"Remote Shell Server"="C:\\rss.exe 22"
+
+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\winlogon]
+"AutoAdminLogon"="1"
+"DefaultUserName"="Administrator"
+"DefaultPassword"="1q2w3eP"
+
+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System]
+"EnableLUA"=dword:00000000
+
+[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Reliability]
+"ShutdownReasonOn"=dword:00000000
diff --git a/client/tests/kvm/deps/setuprss.bat b/client/tests/kvm/deps/setuprss.bat
new file mode 100644
index 0000000..1e4b5a7
--- /dev/null
+++ b/client/tests/kvm/deps/setuprss.bat
@@ -0,0 +1,19 @@
+set rsspath=%1
+if [%1]==[] set rsspath=%~dp0\rss.exe
+copy %rsspath% C:\rss.exe
+
+net user Administrator /active:yes
+net user Administrator 1q2w3eP
+netsh firewall set opmode disable
+
+reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "Remote Shell Server" /d "C:\rss.exe 22" /t REG_SZ /f
+reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "AutoAdminLogon" /d "1" /t REG_SZ /f
+reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "DefaultUserName" /d "Administrator" /t REG_SZ /f
+reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "DefaultPassword" /d "1q2w3eP" /t REG_SZ /f
+reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /d "0" /t REG_DWORD /f
+reg add "HKLM\Software\Policies\Microsoft\Windows NT\Reliability" /v "ShutdownReasonOn" /d "0" /t REG_DWORD /f
+
+rem Just in case reg.exe is missing (e.g. Windows 2000):
+regedit /s %~dp0\rss.reg
+
+start /B C:\rss.exe
-- 
1.5.4.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux