Portable Windows with/without admin privilege

Update: SORRY! It turns out that VirtualBox ties its configuration very closely to specifics of its host machine (such as through the MAC address), so I have to back away from the “portable” claim in this post’s title. Until VirtualBox realizes the value to them of supporting portability, using VirtualBox won’t actually help you go portable.

Previously, I described how to get some freedom from the “no admin privilege” restriction that many workplace computers have. That technique involved running specially-built versions of one’s applications from a thumbdrive. After trying that for a month or more, I grew tired of the following limitations:

  • Many useful apps aren’t built to run from a thumbdrive, often because they use the registry
  • Going back to Firefox from Chrome wasn’t a good fit for me (and Chrome isn’t really portable yet)
  • One can’t control default applications; for example, one can’t directly open links in messages in portable Thunderbird using one’s portable browser

There is a framework called qemu that allows running an entire operating system from a thumbdrive, and it can do so in a mode that doesn’t require admin privilege. But this mode can’t access USB peripherals like keyboards, mice, and other drives connected to the host computer. The final deciding factor against qemu for me is that OSs make many writes to the storage they boot from, and thumbdrives allow only thousands of writes before their storage capability degrades.

If you really want to try qemu before my final solution, here’s what I tried with it:

  1. Install Qemu manager on usb
  2. Set VM RAM to 512MB
  3. Give the VM whatever name you want, and whatever OS label you want…I used “Windows7Portable” for both
  4. Start VM
  5. In VM/Qemu Client, click CD Drive button in menu bar and browse to your Windows 7 RC ISO file
  6. Wait while OS installer gets going…I had to quit and go to bed before it finished

Here are some related links that were helpful:

Because qemu would not be able to use usb-connected keyboard and mouse, because I’d have to copy it to a new thumbdrive fairly often, and because it would be pretty slow by most accounts, I decided to give up on the “no admin privilege required” goal. Instead, I asked my IT dept to install VirtualBox. The following steps were inspired by a Lifehacker post.

  1. Get a portable hard drive. I got a Maxtor 160GB “Basics” model for about US$60.
  2. Plug in the drive to any machine you plan to use where you don’t have full control, then check that you can write to it. (For example, right-click in the drive contents shown in Windows Explorer and choose New | Text Document.) If you can’t write to it, ask your IT dept to grant you write permission for it.
  3. If you’re going to overwrite a virtual disk file you may already have on the portable drive, and you use Chrome, be sure to export your bookmarks and open tabs to the host first. (ouch)
  4. Have VirtualBox installed. Then copy its .VirtualBox directory to your portable hard drive.
  5. Start VirtualBox and go to File | Preferences | General. Change “Default Hard Disk Folder” and “Default Machine Folder” to .VirtualBoxHardDisks and .VirtualBoxMachines on your portable drive.
  6. In VirtualBox, press the New button.
  7. Click through the Next buttons, including leaving virtual memory at 512M.
  8. Click through more Next buttons, including the creation of a new boot (virtual) hard drive of size 20GB. This virtual drive will be kept in .VirtualBoxHardDisks
  9. Choose Dynamically-Sized storage
  10. Take a lunch break while the VDI is created. I also created a brief “reward if returned” text file with contact info at the root of the portable drive.
  11. Once your virtual drive is created, click the Settings button, then the CD/DVD tab and the Add button, and browse to the ISO file of the OS you want to run in the virtual machine. For me, this was Windows 7 RC and my “host” is Windows XP. Click Ok and return to the main VirtualBox window.
  12. Click the Start button. You should eventually see the OS installation prompts. Answer the prompts the way you would if you were installing to a machine sitting right next to your current one and on the same network.
  13. When the OS has been installed (it may need to reboot itself within the window a couple times, but won’t affect the rest of your computer), go to Devices and select Install Guest Additions. This will make it much easier to use your keyboard and mouse. (If you have difficulty getting to the menu, hit the Ctrl key on the right of your keyboard and then try again.)
  14. Once the OS is installed, you can move or delete the ISO file. If VirtualBox complains about not being able to find the ISO file, just use the button to remove it from the CD/DVD mounts.
  15. To get access to folders on the host machine:
    1. Turn on sharing for each of the folders you want to access.
    2. In your VM window, go to Devices | Shared Folders. The “Folder Path” browse button should allow you to select one of the folders you just shared
    3. To make the shared folder appear among the drives shown under Computer in your VM OS (“the guest machine”), go to the Start menu, type in “cmd”, and then type in “net use s: \vboxsrvMyHostFolder” where MyHostFolder is replaced by the name of a folder you shared, and where s: is replaced by a drive letter not already in use.
  16. You should now be able to copy all the data folders from your host to the guest.
  17. Go ahead and install all the apps you need on the guest. I have some recommendations:
    1. Do not install an antivirus program. They can make your guest unusable by turning its display to snow and ignoring your commands. This is the most significant sacrifice I’ve encountered so far.
    2. Use Mozy to backup your data. The first 2GB is free, and you won’t have to remember to backup again.
    3. Windows Explorer settings
      • Change default folder to Computer
        1. Right-click on Windows Explorer in taskbar
        2. When “Windows Explorer” appears in the “jump list”, right-click on it and select Properties
        3. For Target, enter
          %windir%explorer.exe ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
      • Organize | Folder and Search Options | View
        • Show hidden files, folders, and drives => checked
        • Hide extensions for known file types => NOT checked
        • click Apply to Folders and have it apply to all folders
    4. Control Panel | Programs | Turn Windows features on or off | Games => NOT checked
    5. Control Panel | Taskbar and Start Menu | Start Menu | Customize
      • Computer, Control Panel, Personal folder = > Display as menu
      • Documents, Games, Music, Pictures => Don’t display
      • Run => checked
      • System admin tools => Display in All Programs and the Start menu
      • Use large icons => NOT checked
    6. Pin to taskbar: Cmd shell, Calculator, CharMap
    7. Set built-in Windows Defender (anti malware) to run everyday over lunchtime instead of at 2am, since the portable drive may be disconnected overnight.
    8. Media players like Winamp stutter when run in a VM. I run them from the host instead.
  18. If some of the options for setting screen resolution in your guest are disabled, you might be able to enable them by running this in a cmd window in the host:
    C:Program FilesSunxVM VirtualBox>VBoxManage setextradata global GUI/MaxGuestResolution any
  19. Whenever you need to take the portable drive with you, go to Machine | Close | Save Machine State. All your open windows and state will be saved and the VM will close. Quit VirtualBox so it doesn’t hold onto the VDI file on the drive, then unmount the drive via Safely Remove Hardware. If something still won’t let you unmount, then you may have to shutdown the host.
  20. I have been closing down my VM every night, because when I’ve allowed it to run for several days before shutting down, VirtualBox seems to get stuck in a “stopping” state. It’s not clear if this is a bug in VirtualBox or a behavior in Windows 7 that can be configured not to happen.
  21. Finally, as a note to myself, here are some preferred Win7 settings and applications:
    1. Desktop context menu | View | Small icons
    2. Unpin Windows Media and IE from taskbar
    3. Taskbar properties:
      1. Use small icons
      2. Dock at bottom
      3. Never combine/stack buttons
    4. My favorite apps:
      • Java 1.6 SDK with Netbeans
      • Chrome from the dev channel
        • Create a shortcut and append –enable-sync to the Target value
        • While I would like to pin the shortcut to the taskbar, I’m not sure the –enable-sync flag would survive that, so I put the shortcut in the Startup folder instead. (My bookmarks on different machines have been out of sync for a few days, and I suspect this is because I was starting the browser from the taskbar.)
        • Install AdSweep ad-blocker extension by clicking here
        • under (wrench menu)
          • Turn on syncing of bookmarks
          • Always show bookmarks bar
          • under Options
            • under Basics
              • On startup | Restore the pages that were open last
              • Home page | Show Home button on the toolbar => off
            • under Personal Stuff
              • Passwords | Offer to save
              • Themes | Get Themes | Themes by Google | Greyscale
            • under Under the Hood
              • Download location | Desktop
              • Ask where to save each file before downloading => off
        • Right-click on these tabs and select Pin to tab:
          • Evernote
          • Gmail
          • Gmail calendar
          • Google reader
        • Right-click in address box and select Edit Search Engines, then change these keywords:
          • Wikipedia => w
          • Google Scholar => s
          • Lifehacker => l (small L)
          • Amazon => a
          • Google groups => g
          • Download.com => d
          • Google image search => i
          • Youtube => y
          • Ebay => e
        • Wishlist: Save session/open-tabs, Pinned tabs, and Search Engine Settings to Google bookmarks or some obvious file that I could backup
        • Wishlist: An official theme that matches my Windows default theme!
      • Mozy
        • I keep all my files in 4 desktop folders; I backup only parts of these:
          • Business
          • Papers: Articles by others in PDF and HTML format
          • Projects: Workspaces for IDEs, Todo lists, etc
          • Tools: Portable apps, Printer drivers, Installers
        • Schedule | Alert me if a backup hasn’t happened in this many days => 1
        • Options
          • Notify me when a backup starts => off
          • Show status when a backup successfully completes => off
      • portable Thunderbird email client with Lightning calendar extension
        • Pin to taskbar
      • Notepad++
        • Pin to taskbar
        • Settings | Preferences
          • Global
            • Toolbar | Hide => checked
            • Tab bar | Vertical => checked
            • Tab bar | Enable close button on each tab => checked
          • Misc | Remember current session for next launch => checked
      • portable PDF XChange Viewer
        • Pin to taskbar
      • IZArc unzipper
        • During install, make these settings:
          • Explorer Enhancements tab: Extract Here, Extract to <folder>, Email, Create self-extracting, Test, Display icons on context menus => NOT checked
          • Program Locations tab: Default viewer => Notepad++
        • Wishlist: a setting that allows “Extract all subfolders” as the default
      • OpenOffice
        • Pin to taskbar
      • doPDF virtual printer (use browser’s Print command to create PDF version of webpages for archiving)
    5. Pidgin
      • Don’t pin to taskbar; it will be added to hidden system tray
      • Buddies | Show | Offline buddies
      • Create shortcut and drop in Startup folder
      • Preferences
        • Interface | Show IMs and chats in tabs => off
        • Conversations | Enable buddy icon animation => off
        • Sounds : Enabled only for “Message received”
        • Logging | Log all instant messages => on
    6. TweakLogin
    7. Google Calendar gadget. Move to lower right corner.
    8. Amzi Eclipse IDE version 8 for Prolog and Java
      • Pin to taskbar
      • Set workspace to DesktopToolsEclipseWorkspace
  22. One would think that “.pdf” would appear at Control Panel | “Associate a file type or protocol with a program” but it doesn’t. Instead, double-click any PDF, choose “select a program”, choose your PDF viewer, and make sure the checkbox is checked for “always use the selected program”. (This entire step is probably only necessary because I use the portable version of the viewer, and it doesn’t create entries in the registry.)
  23. Go to Control Panel | Devices&Printers and add the office Grayscale and Color printers
  24. Get more free wallpapers from Microsoft
Print Friendly, PDF & Email