<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>P Nash &#187; seamless integration</title> <atom:link href="http://plumnash.com/tag/seamless-integration/feed/" rel="self" type="application/rss+xml" /><link>http://plumnash.com</link> <description>adventures of a gentleman</description> <lastBuildDate>Sun, 30 May 2010 14:05:20 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>VirtualBox Enhancement for Opening WinXP Applications</title><link>http://plumnash.com/it/virtualbox-enhancement-for-opening-winxp-applications/</link> <comments>http://plumnash.com/it/virtualbox-enhancement-for-opening-winxp-applications/#comments</comments> <pubDate>Sun, 16 Nov 2008 20:13:54 +0000</pubDate> <dc:creator>peter</dc:creator> <category><![CDATA[IT]]></category> <category><![CDATA[microsoft word on linux]]></category> <category><![CDATA[office]]></category> <category><![CDATA[seamless integration]]></category> <category><![CDATA[ubuntu]]></category> <category><![CDATA[VirtualBox]]></category> <category><![CDATA[virtualisation]]></category> <category><![CDATA[winxp]]></category><guid
isPermaLink="false">http://www.pjlnash.co.uk/blog/?p=39</guid> <description><![CDATA[This guide explains how to open Microsoft Word Files from an Ubuntu host in Microsoft Word using a Windows XP Virtual Machine. In fact, this mechanism can be used to open lots of file types in seamlessly in any Guest from any Host. This extensions builds upon the seamless integration provided by VirtualBox to create [...]]]></description> <content:encoded><![CDATA[<p>This guide explains how to open Microsoft Word Files from an Ubuntu host in Microsoft Word using a Windows XP Virtual Machine. In fact, this mechanism can be used to open lots of file types in seamlessly in any Guest from any Host. This extensions builds upon the seamless integration provided by VirtualBox to create a more convenient user interface for using multiple operating systems in parallel.</p><h3>Motivation</h3><p>I use VirtualBox to open Microsoft Word programs on my Ubuntu host in my Windows XP Virtual Machine. I found this was extremely frustrating, firstly finding the file in my Ubuntu, then navigating to the same file in my Windows Virtual Machine and so I requested a new feature: <a
href="http://www.virtualbox.org/ticket/2482">http://www.virtualbox.org/ticket/2482</a>, to run commands in my Windows Guest Machine from my Ubuntu Host.</p><h3>Brief Overview</h3><p>The application launcher installation involves four main steps:</p><ol><li><a
href="#toc-share-of-ubuntu-host-folders">Share of Ubuntu Host folders</a></li><li><a
href="#toc-mapping-of-host-folders-in-windows-xp-guest">Mapping of Host folders in Windows XP guest</a></li><li><a
href="#toc-write-a-script-in-ubuntu-host-used-to-send-file-names-to-open">Write a Script in Ubuntu Host, used to send file names to open</a></li><li><a
href="#toc-write-a-script-in-windows-xp-guest-listening-for-file-names-to-open">Write a Script in Windows XP Guest, listening for file names to open</a></li></ol><h3>Technical Detail</h3><p>The file name is sent from the Host Machine to the Guest Machine using a VirtualBox guestproperty which both the Host and Guest Machines can access. This is periodically checked by the Guest Machine, launching the file using Window XP&#8217;s default launcher.</p><h3>Share of Ubuntu Host folders</h3><p>The Windows Virtual Machine needs to access Host&#8217;s files. Only shared files can be opened on the Window&#8217;s Virtual Machine. I found VirtualBox&#8217;s shared folders too slow, so I shared my ubuntu root using samba; so the files on my hardisk are accessible on the network using //my-laptop/root. This is a potential security risk, so I configured Samba to require credentials (there is also a I.P. filtering option). For people concerned about security, I&#8217;d recommend sharing only your Documents folder.</p><p>To recap, share your root folder, or a &#8216;Documents&#8217; folder. Note only files in this directory can be opened on the Virtual Machine.</p><h3>Mapping of Host folders in Windows XP guest</h3><p>Having presented your Documents folder on the network, map the network drive to Z: (this drive letter is configurable in the Window&#8217;s Script listed below). I found that on a starting my Windows Virtual Machine my machines hostname was not accessible immediately, if you rarely change networks considering using your I.P. which can be resolved instantly.</p><h3>Write a Script in Ubuntu Host, used to send file names to open</h3><p>We need a <a
href="http://www.pjlnash.co.uk/files/vmword.sh">Bash Script</a> to be run in Ubuntu to send the document&#8217;s filename to a named Window&#8217;s Virtual Machine. This script expects a Virtual Machine called &#8216;WinXP&#8217;, change this reference if your Window&#8217;s Virtual Machine name is different.<br
/> <br
/> This script should be used to open Word files, instead of OpenOffice, this can be specified the &#8216;Open with Other Applications&#8217; menu item, when right clicking on a word file. Don&#8217;t forget to make the file executable, using:</p><blockquote><p> chmod +x vmword.sh</p></blockquote><p>If you experience difficulties with this step try running the script from the command line, checking /tmp/vmword.log for output.</p><blockquote><p># This program sends all arguments to a guest property called &#8216;wordfile&#8217; for a Virtual Machine called &#8216;WinXP&#8217;<br
/> VBoxManage guestproperty set WinXP wordfile &#8220;$*&#8221; &gt; /tmp/vmword.log</p></blockquote><h3>Write a Script in Windows XP Guest, listening for file names to open</h3><p>We now need a more complex <a
href="http://www.pjlnash.co.uk/files/vmword.bat">Window&#8217;s Batch Script</a> to receive and open the filename. This should be started on Window&#8217;s startup, by copying into the Startup folder in the Windows Startup Menu; there may be better ways to make this a daemon.</p><p>I am unfamiliar with Batch Programming, so this script could probably be neatened, but it does the following:</p><ol><li>Checks for new filenames every second (unfortunately using inefficient polling)</li><li>Converts the filename from the Linux Location to the Windows location</li><li>Opens the file</li></ol><p>The script requires the sleep program, this is included the rktools.exe, which can be downloaded from: <a
href="http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&amp;displaylang=en</a><br
/> <br
/> The filename conversion process is dependent on which folder you shared, and which drive is mapped to that share.<br
/> My conversion process is basic and does the following:</p><ol><li>Removes &#8216;Value:  &#8216; from the Value returned from the VBoxcommand</li><li>Prefixes filename with &#8216;z:&#8217;</li></ol><blockquote><p>@echo off<br
/> rem This batch script listens to the guestproperty &#8216;wordfile&#8217; for its machine.<br
/> rem The program checks to see if a value is set, and if so, changes the name from<br
/> rem &#8216;/file.doc/&#8217; to &#8216;z:/file.doc&#8217;<br
/> rem The word file is then opened in a new cmd window executing the filename, which opens in the default application.<br
/> rem This program requires sleep, which is included in rktool.exe to be installed from<br
/> rem http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&amp;displaylang=en</p><p>:start</p><p>sleep 1<br
/> VBoxControl -nologo guestproperty get wordfile | find /v &#8220;No value set!&#8221; &gt; read.txt</p><p>if errorlevel 1 goto start</p><p>rem Read file and get filename and convert</p><p>type read.txt<br
/> setlocal enabledelayedexpansion<br
/> set SEPARATOR=/<br
/> set filecontent=<br
/> set root=z:<br
/> for /f &#8220;delims=&#8221; %%a in (&#8216;type read.txt&#8217;) do (<br
/> set currentline=%%a<br
/> set filecontent=!currentline!<br
/> )</p><p>rem trim string; removing VirtualBox text<br
/> set filecontent=%filecontent:~7%</p><p>set overallfilecontent=&#8221;!root!%filecontent%&#8221;</p><p>echo The file contents are: %overallfilecontent%</p><p>rem start program<br
/> start cmd /C %overallfilecontent%</p><p>rem delete filename from guestproperty.<br
/> VBoxControl -nologo guestproperty set wordfile</p><p>goto start</p></blockquote> ]]></content:encoded> <wfw:commentRss>http://plumnash.com/it/virtualbox-enhancement-for-opening-winxp-applications/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- This site's performance optimized by W3 Total Cache. Dramatically improve the speed and reliability of your blog!

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 8/12 queries in 0.041 seconds using disk

Served from: pjlnash.co.uk @ 2010-07-31 06:12:32 -->