From: Yaniv Kaul <ykaul@redhat.com>
To: Michael Goldish <mgoldish@redhat.com>
Cc: KVM List <kvm@vger.kernel.org>,
Autotest mailing list <autotest@test.kernel.org>
Subject: Re: [RFC] KVM-Autotest: remote shell utility for Windows guests
Date: Wed, 08 Jul 2009 11:16:23 +0300 [thread overview]
Message-ID: <4A5455D7.5020906@redhat.com> (raw)
In-Reply-To: <1393297377.138291247039194821.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
On 7/8/2009 10:46 AM, Michael Goldish wrote:
> I'm resending the message because it probably got filtered out due to the
> attached setup.bat file.
>
> The contents of setup.bat were:
>
> copy D:\rss.exe C:\
>
> 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
>
You may want to add 'DefaultDomainname' to be equal to the local
machine's name.
> reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "DefaultPassword" /d "1q2w3eP" /t REG_SZ /f
>
> ----- Original Message -----
>
> Hi,
>
> In an attempt to solve the SSH problems we have with Windows, I wrote a little
> remote shell utility to replace the OpenSSH server we're currently using with
> Win(2000|XP|2003) and the builtin Telnet server we're using with Win2008.
> It also works with Vista, for which we currently have no other solution.
>
Personally, I prefer STAF.
>
> Features:
> - Listens on a requested port (22 by default).
> - Provides clients with a cmd.exe shell.
> - Multiple clients can connect simultaneously.
> - Uses no authentication whatsoever.
> - Uses standard API calls that should work on all modern Windows variants.
> - Displays an informative message box if any API call fails.
> - Automatically closes all processes started by a client when it disconnects.
> - Allows clients to run GUI programs (see comment below).
> - Starts minimized by default so it doesn't interfere with step file tests.
> - Reports all activity in a text box.
> - The code is short (450 lines including comments).
>
>
> Tested and verified to work on WinXP 32, 2003 32, Vista 32 and 64, 2008 32.
>
Perhaps you should disable UAC on Vista and friends.
> I haven't tested it on other Windows versions but it should work (should be
> interesting to test it on Windows 7).
>
> The source code is attached. I used MinGW (with Code::Blocks) to compile it
> under WinXP. Link it with ws2_32.lib. If anyone wants the binary please let
> me know and I'll send it somehow (I don't know if I'm supposed to send
> binaries to the list).
>
>
> Problems:
> - cmd.exe echoes back the command line sent to it. This means commands are
> echoed twice: first by the local terminal and then by the remote cmd.exe.
> So if you send "ver\r\n" to the server you get:
> "ver\r\nver\r\nMicrosoft Windows [Version ...]\r\nC:\\>"
> In order for it to work with Autotest we'll have to make some modifications
> to kvm_utils.kvm_spawn (which should be replaced by kvm_subprocess anyway) --
> specifically disable the local terminal echo, and not assume that the command
> line is echoed exactly once (it may not be echoed at all by Linux guests).
>
> - The server does not send or receive files. For now we can transfer files
> into Windows guests using ISOs (-cdrom). If it turns out to be necessary, file
> send/receive support can be implemented into the shell server, or we can use an
> open source Windows FTP server or find some other solution.
>
> - Running GUI apps: Vista and 2008 seem to run GUI apps just fine from a remote
> shell, but in older Windows versions you must use cmd /c
> (e.g. "cmd /c notepad").
> To be compatible with all Windows versions, Windows GUI tests should probably
> always use cmd /c to run GUI apps. There's no need to use it for console
> commands (e.g. dir).
> Note that when using cmd /c the command returns only when the GUI app exits.
> Without cmd /c the command returns immediately.
>
> - Some interactive console programs don't behave nicely when their output is
> redirected (to a remote client in this case). One example is the builtin
> ftp.exe. If you want to use it, you should do so without waiting for
> interactive output from the program, which means you should just send the FTP
> commands one by one and hope everything works, and finally send a 'quit'
> command to get back to cmd.exe.
>
ftp -s:filename - script all your FTP.
Y.
>
> Installation on guests:
> The following should be done as a superuser:
> - Copy the program to the guest (C:\ should be fine).
> - Disable the firewall.
> - Enable the Administrator account.
> - Make Windows logon automatically using the Administrator account.
> - Make the server program run automatically on startup.
>
> I'm attaching a setup.bat file that does the above.
> setup.bat and rss.exe should be packaged together in an ISO and sent to the
> guest with -cdrom. Note that setup.bat assumes that rss.exe is in D:\.
> This will not be true if we run the guest with multiple hard drives, so we'll
> have to do something about that.
>
>
> Please send me comments if you have any. If you think this isn't a proper
> solution, or if you can suggest a better one, please let me know.
>
> Lucas: if we commit this, where should it go? Under tests/kvm/src maybe?
>
> Thanks,
> Michael
next prev parent reply other threads:[~2009-07-08 8:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <346968471.138231247038986936.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2009-07-08 7:46 ` [RFC] KVM-Autotest: remote shell utility for Windows guests Michael Goldish
2009-07-08 8:16 ` Yaniv Kaul [this message]
2009-07-15 13:47 ` [Autotest] " Lucas Meneghel Rodrigues
[not found] <1175192006.84401246973898728.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2009-07-07 13:39 ` Michael Goldish
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A5455D7.5020906@redhat.com \
--to=ykaul@redhat.com \
--cc=autotest@test.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=mgoldish@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.