Bienvenido! - Willkommen! - Welcome!

Bitácora Técnica de Tux&Cía., Santa Cruz de la Sierra, BO
Bitácora Central: Tux&Cía.
Bitácora de Información Avanzada: Tux&Cía.-Información
May the source be with you!

Sunday, November 23, 2008

Seamless Windows Virtualization in Ubuntu

Source (última edición 2008-10-13)

Rather than have an entire separate Windows desktop, you can run virtualized programs directly on your Linux desktop using the latest (version 1.5.0) rdesktop package that comes with Ubuntu 7.04, and Windows XP Professional's Terminal Services feature.

  • You do not however need a whole Windows installation (and therefore not need a virtualization at all) to:
    • run Windows applications in general. This can be done with the open source project [Wine]
    • use Internet Explorer. See InstallingInternetExplorer

    • edit video, develop web applications, etc... There are very many open source alternatives to your old Windows application. See http://www.osalt.com/

OpenSourceSeamlessVirtualizationResized.png

  • Start a Windows XP pro VM.
    • If using VMware, configure host-only networking, and note the VMs IP address for later.
      • You do not have to use host-only networking. Worked for me with "Custom: Specific visual network" [Ramvi]

    • If using QEmu, use the following command

qemu -m 384 -redir tcp:3389::3389 windows.img</pre></div><p class="line874" align="justify"> <span class="anchor" id="line-20"></span></p><div align="justify"><ul><li><p class="line862">This also works with <a href="https://help.ubuntu.com/community/VirtualBox">VirtualBox</a>, similarly easy as in <a href="https://help.ubuntu.com/community/VmWare">VmWare</a>. The only "tricky" part is configuring a host-only network in <a href="https://help.ubuntu.com/community/VirtualBox">VirtualBox</a>. Check these links for more information:<a class="http" href="http://ubuntuforums.org/showthread.php?p=2062234#post2062234">http://ubuntuforums.org/showthread.php?p=2062234#post2062234</a> and <a class="http" href="http://www.happyassassin.net/2007/02/06/vmware-to-virtualbox/">http://www.happyassassin.net/2007/02/06/vmware-to-virtualbox/</a> <span class="anchor" id="line-21"></span><span class="anchor" id="line-22"></span><span class="anchor" id="line-23"></span></p></li></ul></div><p class="line874" align="justify">This makes any connections to the localhost port 3389 be directed to the QEmu VM on port 3389, where Windows Terminal Services will run. <span class="anchor" id="line-24"></span></p><div align="justify"><ul><li><p class="line862">In the VM, log in as Administrator. Open the Control Panel (click <strong>Start</strong> → <strong>Control Panel</strong>) <span class="anchor" id="line-25"></span></p></li><li><p class="line862">Enable Terminal Services: in the control panel, click <strong>User Accounts</strong>. Ensure that <strong>Use the Welcome Screen</strong> and <strong>Fast User Switching</strong> are both checked. Click <strong>OK</strong>. <span class="anchor" id="line-26"></span></p></li><li><p class="line862">Allow remote connections: in the control panel, click <strong>System</strong>. On the <strong>Remote</strong> tab, tick <strong>Allow users to connect remotely to this computer</strong>. If you want to connect to a limited account, click 'Select Remote Users' and make sure the user account is in the list. Click <strong>OK</strong>. <span class="anchor" id="line-27"></span></p></li><li><span class="anchor" id="line-28"></span><br /></li><li><p class="line862">In the VM, download <a class="http" href="http://www.cendio.se/files/thinlinc/seamlessrdp/seamlessrdp.zip">http://www.cendio.se/files/thinlinc/seamlessrdp/seamlessrdp.zip</a>. Extract to <strong>C:\seamlessrdp</strong>. Ensure that the user account that you want to access has permissions to access this folder. Then log out of the VM. <span class="anchor" id="line-29"></span></p></li><li><p class="line862">If you don't have 'Internet > Remote Desktop Viewer' then install <strong>rdesktop</strong> on the host. See <a href="https://help.ubuntu.com/community/InstallingSoftware">InstallingSoftware</a>. <span class="anchor" id="line-30"></span></p></li><li>Test running an application seamlessly. <span class="anchor" id="line-31"></span><span class="anchor" id="line-32"></span></li></ul></div><p class="line867" align="justify"><span class="anchor" id="line-33"></span><span class="anchor" id="line-34"></span></p><div align="justify"><pre>rdesktop -A -s "c:\seamlessrdp\seamlessrdpshell.exe C:\Program Files\Internet Explorer\iexplore.exe" <IP of VM>:3389 -u administrator -p password</pre><span class="anchor" id="line-35"></span><span class="anchor" id="line-36"></span></div><p class="line862" align="justify">For QEmu, use 'localhost' for <IP of VM>. For VMWare and for <a href="https://help.ubuntu.com/community/VirtualBox">VirtualBox</a>, use the IP address noted down earlier. <span class="anchor" id="line-37"></span><span class="anchor" id="line-38"></span></p><p class="line874" align="justify">A large window will pop up briefly with the Windows login screen, then your application should start in its own window. <span class="anchor" id="line-39"></span><span class="anchor" id="line-40"></span></p><p class="line862" align="justify">You can now create a desktop launcher to run the command above in future, when the VM has been started. High-resolution .PNG icons for Windows applications are available from <a class="http" href="http://deviantart.com/">DeviantArt</a>. <span class="anchor" id="line-41"></span><span class="anchor" id="line-42"></span></p><p class="line867" align="justify"> </p><h3 id="Making Windows Apps Look at Home in Ubuntu" align="justify">Making Windows Apps Look at Home in Ubuntu</h3><div align="justify"> <span class="anchor" id="line-43"></span><span class="anchor" id="line-44"></span></div><p class="line874" align="justify">To help Windows apps look at home in Ubuntu, you may configure Windows to use the Ubuntu Human theme. <span class="anchor" id="line-45"></span><span class="anchor" id="line-46"></span></p><p class="line867" align="justify"><img alt="SeamlessVirtualizationWithThemingResized.png" class="attachment" src="https://help.ubuntu.com/community/SeamlessVirtualization?action=AttachFile&do=get&target=SeamlessVirtualizationWithThemingResized.png" title="SeamlessVirtualizationWithThemingResized.png" /> <span class="anchor" id="line-47"></span><span class="anchor" id="line-48"></span></p><div align="justify"><ul><li><p class="line862">In the VM, download the <a class="http" href="http://www.deviantart.com/deviation/37743373/">Human for Windows theme</a> from <a class="http" href="http://www.deviantart.com/download/37743373/">http://www.deviantart.com/download/37743373/</a>. Extract the file to <strong>C:\windows\resources\Themes</strong>. <span class="anchor" id="line-49"></span></p></li><li>In the VM, specify the theme to be used for Terminal Services in\the Group Policy Object Editor.  <span class="anchor" id="line-50"></span><ul><li><p class="line862">Click <strong>Start</strong> → <strong>Run</strong>. Then type <strong>gpedit.msc</strong>.  <span class="anchor" id="line-51"></span></p></li><li><p class="line862">In the Group Policy Object Editor, navigate to <strong>User Configuration/Administrative Templates/Control Panel/Display/Desktop Themes</strong>.  <span class="anchor" id="line-52"></span></p></li><li><p class="line862">Open the <strong>Load a specific visual style file or force Windows Classic</strong> setting. Enable the setting, and enter <strong>%windir%\Resources\Themes\Human\Human.msstyles</strong> as the style. <span class="anchor" id="line-53"></span></p></li></ul></li><li><p class="line862">Note: Windows 2003 only must also enable the Theme Service under <strong>services.msc</strong>. <span class="anchor" id="line-54"></span></p></li><li><p class="line862">Log out of Windows (you <strong>must</strong> log out of <strong>all</strong> accounts) <span class="anchor" id="line-55"></span></p></li><li>Test your application from the host: <span class="anchor" id="line-56"></span></li></ul></div><p class="line867" align="justify"><span class="anchor" id="line-57"></span><span class="anchor" id="line-58"></span></p><div align="justify"><pre>rdesktop -A -s "c:\seamlessrdp\seamlessrdpshell.exe C:\Program Files\Internet Explorer\iexplore.exe" <IP of VM>:3389 -u administrator -p password

If using QEmu, use 'localhost' rather than the IP of the VM.

The new theme will take effect after the login screen.

Some themes that are larger or smaller than default might show a few lines of the Windows wallpaper color.

Shortcomings/Notes

  • Due to limitations in Windows XP clients, only one user can be logged in remotely at a time. The way the current solution is designed, this translates to one program running at a time.
    • I find that the best application to start is "C:\WINDOWS\SYSTEM32\taskmgr.exe". It lets you start more applications and got options for logging out (which you should do when done with Windows. Or else I've found that you're not able to log back in) ~~~~
    • Not necessarily. I've found that if you launch a program that can launch other programs (ex: my computer or cmd.exe), you can use it to open other programs, which then also show up as windows. I've tried it, and I was able to run Internet Explorer and Adobe Acrobat at the same time. The limitation seems to be in the windows program, not anything in rdp. -- JoeTerranova

    • However, RDP 6.0 (since Windows Server 2003 SP1) supports running individual programs, so no need for seamless desktop. Does rdesktop support 6.0 features yet? -- MarkReitblatt

      • Not yet. Ideally needs Microsoft need to release the protocol documentation. --ChrisRose4

    • There's an unofficial patch for XP Service Pack 2 that allows you to run unlimited concurrent remote user sessions to get around this limitation (it uses a terminal services library from a beta of SP2 that accidentally removed the limitation). It's probably OK for home users although I wouldn't recommend it for a business. http://www.kood.org/terminal-server-patch/

    • If you add a registry DWORD called NoDesktop to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer and set it to 1 then log out and log in, you can start explorer in your rdesktop command line and get just a Windows taskbar. Of course, then you can't see your desktop if e.g. you log in using VNC. see http://www.linux.com/feature/124908?theme=print

  • The Human theme does not work in Windows XP x64.
  • There is an unofficial rdesktop version with seamless support made by Fontis IT Consulting. It's provide some interesting feature like loading multiple application in a Master Slave mode. So you can call rdesktop several time to open more application in the same user session. http://www.fontis.com.au/rdesktop

  • There is a freely available utility that launches a launchpad from which you can configure and run several applications from one seamlessrdp session. http://www.miguelfurtado.com/srdp.aspx

  • The Windows classic theme has glitches on the taskbar - use the hideous Luna theme or Human theme instead :)

  • XP Pro SP3 with the Hardy and Intrepid alpha 6 versions of rdesktop caused segmentation faults all over the place for me - I found that the 1.5.0 version from Debian doesn't have this problem - see https://bugs.launchpad.net/ubuntu/+source/rdesktop/+bug/275545 - fubarbundy

  • The 1.6 version of rdesktop in Intrepid seems to not hide window decorations - Hardy's 1.5 version or Debian's 1.5 and 1.6 versions don't have this problem - see https://bugs.launchpad.net/ubuntu/+source/rdesktop/+bug/275528 - fubarbundy

  • At least for XP Pro SP3, you can improve the appearance of Windows by enabling 24 bit colour and font smoothing. In Windows, run regedit, change HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\ColorDepth to 4, under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations add a DWORD called AllowFontAntiAlias and set its value to 1, and under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp add an identical key (AllowFontAntiAlias 1). Restart Windows and Robert's your mother's brother. - fubarbundy

No comments: