Windows XP Mode Internals – Part 2 (Application Publishing Magic)

committed to database on April 28, 2009 at 10:50 pm Eastern Standard Time 58 comments digg this

As mentioned in that boring overview yesterday, Windows XP Mode (XPM) utilizes some key RDP (6.1+) technologies to enable seamless virtual application use in Windows 7. More specifically, Remote Applications and Application Publishing.

For those not Terminal Services wizards, these technologies may sound new. Application Publishing enables you to “install” an application on a client machine – at least as far as the user is concerned. Shortcuts and file-type associations are set up, just as a local installation would, but when the application is invoked it’s started on a server somewhere within your infrastructure. The Remote Applications piece then kicks in and draws the client UI in a very convincing manner.

XPM eliminates the publishing step in the traditional Terminal Services model by incorporating monitoring logic within the Virtual Machine Services components installed on Windows XP for you, at first run. This component, amongst other things, monitors the (All Users) Start Menu for shortcut additions and deletions. For example, after detecting an added shortcut XPM adds the application to the Remote Applications white-list, nabs its icon, and performs some other internal house keeping tasks before passing the baton to the host operating system for addition to the Virtual Applications list in the Start Menu.

In the video below, I demonstrate just that with Internet Explorer 6.

As shown in the video, one of the (current?) limitations with XPM (as a result of client Terminal Server licensing) is that only one user or channel can be open at any given time. This means you cannot execute Internet Explorer 6 while running maintenance tasks within the virtual machine, like installing updates from Windows Update. For the tinker tots, however, you may want to patch the Windows XP guest to allow simultaneous RDP sessions. Doing so, of course, is a violation of a few EULAs but it’s worth the gain in knowledge. It’ll be our little secret, okay?

  1. Alan April 28, 2009 at 11:44 pm

    I like how it automaticlly adds the shortcut from the XP session to the Windows 7 session… I take it that you have to use the VHD that comes with the XP Mode due to the RDP 6.1+ technology requirements that would not be in a normal install of XP.

  2. Rafael April 28, 2009 at 11:51 pm

    @Alan: The VHD is just plain Windows XP SP3 w/ hotfixes. The integration components that install afterward, however, is what contains all the magic.

  3. Peter April 29, 2009 at 2:05 am

    What do you think about similarities with vmware unity?

  4. Joao April 29, 2009 at 2:11 am

    Does it allow running XP file explorer virtually? That would be a HUGE selling point for me.

  5. Jaryth000 April 29, 2009 at 2:53 am

    @Joao’s question:
    Thats damn good question. Like, if you stuck an Explorer Icon into the start menu, you could launch it right?

    Then again… you would only have browsing access to the files on the Virtual disk right? damn… UNLESS you set up some network drives… hmmmm thats getting to complicated…

  6. Leo Davidson April 29, 2009 at 4:43 am

    I wish Vista (and Windows 7) would allow multiple RDP sessions as well, even if it was restricted. (e.g. Only admins can start a second session, it’s time-limited and you can only open three apps. That would do fine!)

    Why? Media Center.

    If someone is watching TV via Media Center on my HTPC, but I want to log-on and do some admin task, I have to kick them off, which annoys both them and me. Them because it stops their video and blanks the screen. Me because I have to wait 30 seconds while they are asked whether or not they want to allow me to take over. (If there is even someone at the TV at the time, and I’m not sure if they can respond to the prompt with the remote control anyway.) (Is there a way to stop that 30 second prompt? I’m the administrator; I should be able to take control immediately without them getting the option to say no.)

    The icing on the cake is that once I’m done doing admin stuff, if I just disconnect then the screen — i.e. my TV — will be left locked. Which is awesome when there’s no keyboard plugged in to unlock it and when I don’t want everyone to know the password. That means every time I RDP to my HTPC to do admin work I have to finish by rebooting it.

    All because of a completely artificial policy restriction. :-|

    Media Center rocks overall but I wish Microsoft would be a bit more committed to it (i.e. fix all the damn screensaver/focus-loss video-restart/unpause bugs, for the love of god) and think a bit more about how people will use it (i.e. we need to use RDP to maintain the thing because nobody wants a keyboard plugged into their freaking television!).

  7. Leo Davidson April 29, 2009 at 4:46 am

    @Joao:
    “Does it allow running XP file explorer virtually? That would be a HUGE selling point for me.”

    So you can run a file manager that only sucks (XP) instead of one that is virtually unusable (Vista/Win7)? :-)

    Better to use on that is actually good, e.g. Opus. (Disclaimer: I am a huge Opus fanboy.)

  8. Whiner April 29, 2009 at 4:47 am

    I miss the network activity animation on the taskbar and Windows Meeting Space which would allow ad hoc desktop sharing without an internet connection.

  9. MPX April 29, 2009 at 5:13 am

    So the ‘additions’ component does the auto-publishing step and the Start menu folders inside the 7 Start menu is set up to be shared with the XP VM where the published/packaged shortcut goes, no need for “monitoring logic”?

  10. Vincent Bethmann April 29, 2009 at 7:54 am

    How does it fit into Aero? Is it seen in Flip3D and taskbar previews?

  11. Chad Chisholm April 29, 2009 at 11:15 am

    I cannot run Vista because I need a version of Cisco’s VPN client that no likey the Vista. Will I be able to run a VPN Client in XPMode and actually connect to my company’s network?

  12. Chris April 29, 2009 at 2:28 pm

    Why it is so slow?
    Does it stop the vm when starting the app?

  13. Rafael April 29, 2009 at 2:29 pm

    @Chris: Because I was using Windows Media Encoder 9 to record the desktop. And no, it merely logs out my current session.

  14. BG April 29, 2009 at 2:47 pm

    are the apps you run restricted to the vhds file system, or can they access the host as well?

  15. Tom April 29, 2009 at 3:45 pm

    @Leo: Agreed, concurrent login restrictions have always been a major problem with the Remote Desktop implementation. Your idea of a restricted second session is a good one, although time limits are probably a no-go (what if I’m installing a big Service Pack, or troubleshooting?). I’m not sure Microsoft’s cannibalization fears with Remote Desktop are justified — surely Windows is not going to lose the desktop through two-for-one license consolidation (one Windows machine, one Linux machine that’s only used to RDP in). Especially since Remote Desktop is only available in the higher SKUs.

    Note, however, that you don’t necessarily have to reboot after termserving in. Although the Start menu defaults to disconnecting without logoff, you can log off the admin user in two ways: (1) Issue the “logoff” command from the command prompt (2) Open task manager and go to the “Users” tab — notice two distinct actions: Disconnect and Logoff. This still leaves the screen locked, but on the TV user account rather than the admin — so you should be able to log back in using the MCE remote control.

    And, frankly, I don’t see why logoff isn’t one of the options on the Start menu anyway …

  16. Kevin blakeley April 29, 2009 at 6:12 pm

    @Chad, I would like to know this as well. Is there anyway to get a confirmation on how a scenario like this would work?

  17. Rafael April 29, 2009 at 6:19 pm

    @Chad, @Kevin: Googling around, it appears people are quite successful with using Cisco VPN software with VPC on Windows XP. You could then set up shortcuts to access VPN resources seamlessly. Good idea!

  18. Sean April 30, 2009 at 12:57 am

    So how is this going to work with proprietary programs that are coded for Windows XP. I mean I worked in an insurance company and they the Chief admin never switched to Vista and he had no want to up grade to 7 either…. And from what I read on Neowin, its going to offer 100% compatibility like a nativity running copy of XP. I mean why is this? Minus a few tweaks under the hood it is just a XP SP3.

  19. azz0r April 30, 2009 at 4:27 am

    Shame they haven’t hacked it up abit so that the relavent icon appears on the taskbar. Be kinda neat seeing the IE6 logo sitting there.

  20. Leo Davidson April 30, 2009 at 2:49 pm

    azz0r: FWIW I just checked and VMWare’s Fusion feature does put the IE6 (or whatever) icon on the taskbar, at least on Vista.

    I wonder if this Virtual XP stuff does the same thing, but on Winodws 7 you get all of the virtual windows grouped into a single top-level Virtual XP icon on the taskbar? (i.e. Below that icon there may be an IE6 icon.)

    I don’t have VMWare installed on a Win7 machine to see what would happen there.

  21. vahnx April 30, 2009 at 2:50 pm

    Will this be able to play basic 3D games such as Duke Nukem, possibly Counter-Strike?

  22. Sam Johnson April 30, 2009 at 9:46 pm

    @Joao, you sure can. Just add IE as shown in the video and type “C:\” into the address bar. Boom.

  23. Sam Johnson April 30, 2009 at 9:51 pm

    Oh, it also appears that you can launch ANY app from this explorer without having to add it to the menu. Little tip.

  24. Luis May 1, 2009 at 7:41 am

    @Rafael;

    This is by far the best thing microsoft could have done to secure windows 7 on my computer, something that I installed since the M3 build. And now this release candidate.

    To let others know, I am running the 64bit version of windows 7 and I happen to have some devices that some manufactures will not offer 64bit drivers, I was disappointed at them and not with windows since this is not windows fault!
    But now that microsoft has spent the time and effort to put this out, I might as well let other people know;

    If you have a device that has no 64bit drivers, there is a possibility that it can still communicate with the USB integration feature of Microsoft Virtual PC, therefore you are able to install the driver/software in the guest os and actually use your device in the Virtual Environment (not via App Deployment, VM has to be initialized).

    I was happy by the fact that I can now use by old 32bit hardware even though I was running 64bit and only 32bit drivers are available for it!

    Now that I said that, how does it work for you? If you have one of these devices with 32bit drivers only, does it work for you?
    Give it a try.

    And for your info, my device was a usb gps with internal storage that can only be accessed by a tool with the right drivers installed to it can update its files. It shows up as communication device under the usb option of microsoft virtual pc.

  25. EnricoG May 1, 2009 at 8:43 am

    I don’t like the way drives share works: all or none.

    In Virtual PC 2007 it’s possible to share only the drives or folders you really need to share, with the new Windows Virtual PC that is gone and I really don’t like the idea that a less secure OS has access to all my file.
    OK, it cannot write in the Program Files and Windows folders, but it still have full access to all the data on the host OS and that is pretty bad.

    Drag&drop between host and client desktop doesn’t work, it’s something I can live without, but only if the drives integration is fixed.

    Integration right now is supported only for XP SP3, Vista SP1 and Windows 7. I need integration and folder sharing for Windows Server as well.

    It’s always bad when a new version of a product loses some features of the previous one.

  26. Kennight May 1, 2009 at 12:26 pm

    Can you send me the wallpaper of the video or the link for download it please!

  27. lordloki May 2, 2009 at 12:14 am

    has anyone actually confirmed that they can use cisco VPN across the virtualization layer? I don’t seem to be successful. (i do not mean anyconnect, i mean the ipsec vpn).

  28. XPirate May 2, 2009 at 3:58 am

    In the XP Mode beta, offline files seems to be enabled. Is that being used to sync files across the VM and Windows 7?

  29. Ubuntu83 May 2, 2009 at 4:47 am

    Thanks Rafael for all this info. I tried Windows XP mode on Win 7. It’s quite a bit slow. It is still in beta stage so I hope it will improve. As for now VMWare is the champ of Virtualization. Unity mode works like a charm on Windows 7.

  30. Andy May 3, 2009 at 6:41 pm

    I’m wondered about this before.. Why didn’t they just virtualize an XP compatibility mode in the first place and make Vista a completely new kernel and architecture without worrying about compatibility? Even with Windows 7, it appears this is just to guarantee compatibility with old apps… They could have used it as an opportunity to make major changes to the system without worrying about old apps

  31. shadowh511 May 4, 2009 at 10:11 am

    @Andy

    Microsoft’s gonna need some ice for that burn :D

  32. DanielRemains May 4, 2009 at 5:14 pm

    Just to tell everyone, this is available to download on torrent site.. I downloaded and installed it and runs very stable :) Remember, this is a BETA program over a BETA OS (Which is more stable than Vista) I’m on Windows 7 Build 7100 right now and I just love it :D

  33. Mike May 5, 2009 at 3:56 pm

    Does anyone know if it will run if AMD-V is NOT enabled in the bios? Will it fail to run at all? fail to install? The reason why i’m asking this is because on my Compaq laptop, even though the AMD-V compatiblility check finishes successfully, it’s only checking if the CPU has the extenstions, and does not cheque the actual hardware support in the bios (at least to my belief). Since OEM bios’ are heavily modified and the settings all hidden, i’m unable to determine if it’s enabled or not.

    So, in light of that, could Virtual XP be using software mode, if it doesn’t detect virtualisation enabled in the bios? If you have this option in the bios, can you turn it off and see if Virtual XP will install and run without warning/error messages?

  34. chris May 5, 2009 at 8:41 pm

    Is the user account in the vm a member of the xp’s admin group?

  35. John Dunsire May 7, 2009 at 3:18 am

    Hi Guys

    Been playing with this feature and found the Start Menu Publishing has a exclusion list in the VM registry. Anything listed in there won’t show on the Windows 7 Start Menu. Registry Key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtual Machine\VPCVAppExcludeList

    In there you’ll find things like explorer.exe & mstsc.exe all the XP games exe ( god knows why MS just didn’t remove the games from the vhd). I deleted explorer.exe and mstsc.exe from the list and rebooted the VM from the action menu. I now have Explorer and RDP on my Windows 7 Start Menu. I have installed Cisco VPN Client which works fine. I now can kiss x86 Windows goodbye.

  36. Nic Bedford May 8, 2009 at 3:59 am

    Hey Rafael, and idea how VMCPropertyHandler.dll@LaunchDefaultVM knows which is the default VM, and how we can change this value so that a different VM can be launched?

  37. Tommy Mhire May 13, 2009 at 1:52 pm

    Rafael,

    Any way to get XP mode to utilize more than just your main monitor? It looks like it’s using seemless RDP to present the apps on the windows 7 desktop. Is there some way to insert the /span switch into the string that starts the virutal enviornment?

  38. Drew Martell May 19, 2009 at 7:59 am

    @John Dunsire

    God, thank you so much! I’ve been wanting to run MSPaint and this is the perfect solution! One question: Some shortcuts still have issues. I have Firefox installed and copied the shortcut into the All Users start menu of the VM and it’s not showing in the host OS, and there’s no entries in the VPCVAppExcludeList. Do I need to manually add it in the AppAllowList, and if so how do I do that? Also, when I had Firefox 3.5 Beta 4 installed, it worked fine but with 3.0.10, no integration.

  39. Drew Martell May 19, 2009 at 8:01 am

    Edit: Nevermind. When I installed 3.0.10 it replaced 3.5 Beta 4 but kept the folders/shortcuts with the same name. Launching 3.5 Beta 4 shortcut opened 3.0.10 :) Sorry for the double post.

  40. Choto Cheeta May 20, 2009 at 2:53 am

    Hi,

    There is a doubt for the last paragraph of the post.. On my first run, I could see I can run IE6 and at the same time I can install updates from Windows update !!!

    http://img30.imageshack.us/img30/8065/vxprunning01.jpg

    I didnt do any modification, its just the default XO mode running under Win7..

    May be I am not understanding the meaning of the post properly !!!

    Thanks.

  41. Rick June 2, 2009 at 2:57 am

    Rafael,

    Do you know of a way to upgrade an old virtual machine to have “application publishing” capability

    I have the RC2 and the MS download XPM working fine but I also have some labouriously configured XP virtual machines that contain old MS office installs and other old XP era software that I can’t be bothered reinstalling and reconfiguring again.

    BTW: These old VMs run fine under RC2 with integration features. Very useful too. Just no application publishing.

    Thanks
    Rick

  42. Rafael June 2, 2009 at 7:12 am
  43. Arturo June 19, 2009 at 12:07 pm

    I must say, this XPM just rocks!
    I’ve had some issues with the VPN on Win7 so I figured I’d try XPM, sure enough, the VPN worked flawlessly. I was then able to RDP into the particular server on that particular site. I had to do all this on the XP desktop. Then I thought, what if I just run the XPM VPN from the Win7 start menu + XPM RDP… I didn’t even tried it. I went for the MMC instead. I copied my MMC with all my remote connections from Win 7 to the virtual XP, so now, I run the XPM VPN then I open XPM IE, go to favorites and open my remotes.msc MMC… Works great! Are we loving Microsoft or what?

  44. George Smith August 10, 2009 at 4:34 am

    I see alot of questions about running Cisco VPN on a virtual machine, well yes it works and works fine.
    The way to get it working is to install in XPM and then you basically share the conncetion of the Cisco adaptor.
    I can give more info if needed.

    Now 1 hand washes the other, i need to know will CISCO give support if there is any problem with the connections of VPN whilst using this method????

  45. Adam Sanders August 17, 2009 at 12:23 am

    George Smith: I would love some more information on sharing the connection of the Cisco adaptor with the Windows 7 host. Thanks!

  46. Matt W. August 24, 2009 at 11:18 am

    Hi George,
    I’m finding that I have no problems publishing applications from XP Virtual mode with the integration components installed, but if I build a VHD with our XP/SP3 OSD image and install the integration components, any apps that I install won’t publish. Do you know if a specific KB Hotfix is required for the publishing to work?

  47. Scott August 24, 2009 at 1:57 pm

    I’d love information on this on how to run Cisco VPN in XP Mode or through Windows 7. My VPN blocks outside traffic and I need to use the Internet to research. So could I do this VPN in XP Mode for one browser while in just 7 run another browser for outside Internet with no VPN restricting me? I’m a little new to VPN so don’t have this all figured out but sounds possible. Would love people’s ideas, setups!

  48. Thompson September 23, 2009 at 3:58 pm

    Do you have a updated Reg key to hide / unhide apps that will be published I looked for the one John Dunsire gave but I don’t have it on my Windows 7 Enterprise machine. I am running the RC of Virtural PC.

    You can get your old VM running XP/sp3 to publish apps by installing remoteApp on them.
    http://www.microsoft.com/downloads/details.aspx?FamilyID=e5433d88-685f-4036-b435-570ff53598cd&displaylang=en

    I think there is a version you can install on your VM Vista as well.

  49. smu johnson September 29, 2009 at 5:02 pm

    This is great and all, unfortunately every tutorial on the internet only shows the most basic example, of dragging Internet Explorer on there, or installing a program with an install manager.

    What happens when you want to run a shortcut of a program that is on a mounted network drive? Because the Virtual XP won’t bother with shortcuts, doing this little publishing trick is impossible where it is needed most.

    Same thing happens when you make a shortcut to something like Microsoft Hearts game.

    Perhaps I’m missing something, but unfortunately from my Googling, no one else cares about this small yet important flaw. Can anything be done?

  50. Nirandone October 3, 2009 at 1:44 am

    All of you running cisco ipsec, I am using shrew soft vpn client. It’s free. It can use the Cisco .pcf file. The development releases work with W7 x64 (and beware the stable relase as it BSOD’s. I wasn’t paying attention and it doesn’t say it supports 7 so I experienced it myself :p ).
    And I think it’s faster than the Cisco client, at least logging on is way faster than when I was using the cisco client. But I am comparing between two different OS’es so many things differ, the first one with XP being our corporate image that the desktop team managed to make slow as hell :D

  51. feelit October 7, 2009 at 4:03 am

    I am not able to public remote desktop connection to windows 7. Has anyone else had this problem?

  52. Stefano October 21, 2009 at 5:01 am

    I have many client (up to 5000) Windows 7 and i need to publish an older apps in xpmode.

    I have build and test an xp machine with remote apps etc… it’s all ok.

    Now i need to configure an autologon to this apps (service account). I need to delete the windows 7 authentication windows (when launch xpmode apps).

    If i configure the autologon in windows xp the w7 auth windows appears and if you press cancel you can use correctly the apps (xp autologon works). How i can disable the w7 auth windows?

    …. or ….

    How i can autoconfigure (script?) the credential to access an xpmode machine?

    Thnx all !

    Stefano