• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Procedure for creating a bootable Linux USB key, with an encrypted VM, with Win7?

VirtualLarry

No Lifer
Here is what I would like to do. I would like to use a 32GB USB flash drive, to install a bootable version of Linux onto the flash drive. I would like to also set up a VM on top of Linux (VirtualBox, perhaps), that contains a Windows 7 installation. I would also like the Windows 7 installation to be encrypted.

Does VirtualBox support encrypted virtual HDs?

If not, could I install Linux, such that the home directory for my user was encrypted, and then somehow direct VirtualBox to load the virtual HD from my home directory, so that it would be encrypted?

I'm not all that well versed in Linux, so consider me a n00b. How hard would it be to do this?

I've seen a few guides on the net on how to install Linux onto a USB key, but I don't recall seeing any of them comment on doing so with an encrypted home directory. (Isn't that a standard optional feature of Linux now? Or is that feature distro-specific?)

Also, what distro would be best for using on a USB key? I want it to be usable (successfully bootable) on as many machines as possible, without needing to re-configure.

Edit: Someone should come out with a specific distro for portable Windows under Linux.

Edit: Seems like modern versions of Ubuntu prompt you to encrypt the home directory. But the guides I've seen for making a bootable USB linux install, seem to use their own installer and bypass the distros installer.

Edit: I tried booting an Ubuntu 10.04 LTS distro CD, and having the USB stick plugged in, and selected the USB stick as the destination. I took a nap at noon, and it was at 51%. I woke up three hours later, and it was at 61%. Only the CD was no longer spinning, and the USB stick wasn't blinking with any activity. No noticable activity from the laptop's HD light.
 
Last edited:
Without doing any reading, I'd install Ubuntu on the USB drive from the CD installer. After booting into the USB drive, install VirtualBox, and Win7. I'm not sure what encryption options are given in VirtualBox, but if there aren't any, you could install TrueCrypt on the VM, and encrypt it that way.
 
Yeah, that's what I tried, but the Ubuntu 10.04 LTS installer just kind of died off in the middle. Strange. Didn't pop up any errors, even when I unplugged the flash drive after a period of no activity. When I went to hold down the power button to shut it down, the CD spun up and then ejected.

I tried booting off of the flash drive, but nothing.

So I booted Win7 off of the HD, plugged in the flash drive, and ran vconsole's USB flash drive tester. No errors, over the entire 32GB.

Maybe I'll try it again with a USB portable HD rather than a flash drive. Not as convenient, but probably more robust.
 
I don't know that it'll make a difference, but you could try the alternate install media. That gives you a manual setup, and while it isn't as easy as the regular install, it's easy enough for someone technically inclined.
 
I'm trying UNetbootin, with the Ubuntu 10.04 LTS 32-bit distro ISO. I am puzzled though, it allows you to configure extra space on the flash drive for persistance, but it maxes out the control at 9999 MB. Which is 10GB. The flash drive is 32GB, I wanted to use all of it for the persistance, I want to install a Win7 VM onto it.
 
I have no idea how to do a proper install, manually.

Unetbootin kinda hung up too, it said program not responding.

So I pulled the flash drive out, plugged it back in, formatted FAT32, and now it's missing sectors. Could the flash drive be wearing out already? I just bought it.

Edit: reformatted the flash drive FAT32 in windows, re-ran UNetbootin, and got the flash drive sucessfully installed. I'm currently booted off of it. Any idea how I enable the rest of the flash drive for "persistance"? Or am I going about this the wrong way, and should follow a more detailed guide to install a real installation onto a flash drive, and not just a LiveCD on USB with some persistance?
 
Last edited:
I dunno about the flash drive. They can wear out at any time, even fresh from the package. I've never had an issue with unetbootin, but that doesn't mean you aren't.

To do a full install, you'll have to feel your way through. It's been awhile since I've done it, so I can't remember the exact steps. For the sake of simplicity, I'd disconnect all your hard drives, then boot to the cd. You should then have an Ubuntu desktop with an icon that says install. Click that, and follow the prompts. Since the flash drive will be the only drive on the system, you can install to that without worrying about your main drives. You might want to do an advanced partition scheme, keeping a fat32 partition. Might be useful for Windows portatble apps, or something like that. For just Linux using Ubuntu 10.04, this is my suggested partitioning...

/ 7gb
swap 1gb
/home the rest
 
Good news! I'm booted off of a Linux install right now, on my 32GB USB flash drive.

I tried doing a partial wipe of the flash drive again, and then re-tried the Ubuntu direct install again.
This time, it didn't hang. It took a while, but it worked. Now I can plug in the flash drive and it boots. Takes a while to boot too.

I'm stuck in 1024x768 mode though, it never prompted me to install the NV proprietary drivers for my GTX460. Maybe that card is newer than 10.04. I need to get the resolution issue fixed, before I install VirtualBox. My LCD is 1920x1200. Any ideas?

Edit: I seem to be stuck in 800x600, not 1024x768. It's nearly unbearable.
jockey-gtk is installed, which is supposed to pop up and offer me some proprietary drivers, but it doesn't. The newest driver listed in the software repository is 185-something. Is that new enough to support a GTX460? NV's driver download page is down.

http://ubuntuforums.org/showthread.php?t=1529536
?
 
Last edited:
I don't remember Ubuntu's default settings, but first, open Synaptic, goto Settings-Repositories-Ubuntu Software, and make sure everything is checked. You don't need source code unless you want it. Accept all of that, and if you made changes, hit the Reload button to load the repos.

You can then search for a Nvidia driver from there. It would probably be easier for you to goto(from the main menu in your top panel) System-Administration-Hardware Drivers. It should then scan your system, and report any proprietary drivers that are available. If it pulls one up that's suitable, you can install it from there.
 
I think 173 is the newest driver in 10.04. You can try that, and see if it works.

Edit:
You could also try the nouveau driver and firmware, but the performance won't be as good as the binary,
 
Last edited:
I managed to get the newest NV drivers downloaded from their site. I followed this guide to get them installed:
http://eddieringle.com/how-to-install-official-nvidia-drivers-in-linux/

The NV installer said that the pre-install script failed, and prompted me to continue with the install, so I did. Now I'm at 1920x1200! 🙂

Edit: Previously, I did what you said, I checked the Synaptics package manager, and I checked the proprietary hardware drivers control panel, but all repositories were already checked, and the proprietary drivers tool just said that there were no proprietary drivers on the system.

Edit: How do you access your encrypted home directory in Ubuntu? I read somewhere that there was supposed to be a /Private directory, but I don't see it. I see a ".Private", that is a link to ",ecryptfs/username/.Private"

I want to store my VirtualBox VMs in my encrypted home directory. Do I need to do anything special, or are they already encrypted by default?
 
Last edited:
Cool. Glad you got it working. Keep in mind you may run into issues again on a foreign computer, especially if it isn't running Nvidia. You may have to install different drivers if that happens.
 
Now posting from Windows 7, installed inside a VirtualBox VM, on top of Linux Ubuntu 10.04, on a USB flash drive!

Still unsure if the Windows 7 image file is properly encrypted. But it works as a POC.

Btw, Windows 7 reports "no sound device". I used the VirtualBox wizard, with the setting for Windows 7 32-bit. Surely they would have used a device that Windows 7 has a driver for?

Edit: Got the sound fixed. Told Windows 7 to update drivers over the internet, and it found a sound driver and installed it. Still has an unknown device "Base Device", with no driver for it, don't know what that is, but it might have something to do with the VM addons package I suppose.

Anyways, I can watch Hulu full-screen (1024x768) in Firefox in Windows 7 on VirtualBox, and it's nice and smooth on my quad-core rig.
 
Last edited:
Back
Top