VeraCrypt On the Command Line for Ubuntu Linux

Introduction

In this, the third post on using VeraCrypt from the command line, we’ll cover how to use VeraCrypt from Linux, specifically Ubuntu 20.04.

We’ll cover the basics. Creating a container, mounting a container (aka volume), getting a list of mounted volumes, and finally dismounting your volumes.

As I stated in previous posts, the command line syntax is a bit different for all the major operating systems. In this post we’ll focus on Linux.

Prerequisites

Before you install VeraCrypt, you should be aware it has a dependency on the libwxgtk3.0-gtk3-0v5 library, so we might as well install that first. From the terminal execute these commands.

sudo apt-get update -y
sudo apt-get install -y libwxgtk3.0-gtk3-0v5

Next, in order to format a volume as exFat so it can be used across platforms, you’ll need to install the exFat tools.

sudo apt-get install -y exfat-fuse exfat-utils

Now you’ll need to install VeraCrypt. I went to https://veracrypt.fr/en/Downloads.html and scrolled down to the Linux area. In the Ubuntu 20.04 area, I downloaded veracrypt-1.24-Update7-Ubuntu-20.04-amd64.deb file into my Downloads folder.

In the terminal, I moved to my Downloads folder then issued this command to install it:

sudo dpkg -i veracrypt-1.24-Update7-Ubuntu-20.04-amd64.deb

From here I went into Ubuntu’s menu and launched VeraCrypt to validate it installed correctly.

Code Samples


While I will be providing samples here, you should also check out the project I have on GitHub that goes with this post, https://github.com/arcanecode/VeraCrypt-CommandLine-Examples

I’ll update it over time as needed, and it may be easier for you to download, or cut and paste from it.

OK, let’s get started!

Creating a Container

Before we begin I’d like to make two notes. First, I’ll be storing the container in my Documents folder. So in the terminal be sure to cd into your Documents. This will make it easier as we won’t have to specify full paths to our files.

Second, included in this demo is a randomdata.txt file. We’ll explain its use shortly, but you’ll need to copy this file into Documents as well, or when the time comes include the full path to it.

Let’s start by looking at the long line of code needed to create a container. Please note that while your blog reader may wrap the command below, it should be one line in your shell script or from the command line.

sudo veracrypt --text --create vctest.vc --size 200M --password MySuperSecurePassword1! --volume-type normal --encryption AES --hash sha-512 --filesystem exfat --pim 0 --keyfiles "" --random-source randomdata.txt

OK, that’s a bit hard to read, so let me break it out into each part below.

The first item is the veracrypt command, assuming you installed it in the default location. By default VeraCrypt installs in /usr/bin, but because /usr/bin is in the path you don’t have to specify it when calling VeraCrypt. You do though, need to use all lowercase as Linux is case sensitive. In addition you’ll need to call it using sudo.

sudo veracrypt

The --text parameter says we want to use VeraCrypt in text mode, not GUI. Note, the --text parameter must be the FIRST parameter you pass in, or it will not work.

--text

We next tell VeraCrypt we want to create a new file container, and where it is to be stored at. For this demo, I’m just going to use the Documents directory. Be sure to cd into this folder from the terminal command line before issuing the full command. Otherwise, you can specify the full path to the .vc file you want to create.

--create vctest.vc

Next we indicate how big we want our container to be. If you just list a number, VeraCrypt assumes you mean bytes, but you can also affix M for megabytes, G gigabytes, K kilobytes, and so on.

Here I’m going to keep it small for demo purposes and use 200 megabytes.

--size 200M

Now we provide our password. Normally you would not want to hard code it, but rather pass it into your script as a parameter.

I wanted to keep this demo simple though, and focus on VeraCrypt so I’ve just hard coded it. I’m using the same “super secure” password I’ve used in my last few posts.

--password MySuperSecurePassword1!

Next is the volume type, normal or hidden. In a previous blog post I cover hidden types, and if you are going to do a hidden volume I would suggest using the GUI in order to assure it is done right.

For this demo we’ll go with a normal volume.

--volume-type normal

Now we pick the encryption type. There are quite a few, so refer to the VeraCrypt documentation for a full list. Here we’re using AES.

--encryption AES

Next up, for the encryption method we picked it needs to know the hashing algorithm. For AES I suggest SHA-512.

--hash sha-512

In order to keep this container portable across other OS’s (Windows and macOS) we’ll format using exfat. In order to format as exFAT, you’ll need to have installed the exFAT utilities on your system (see the Prerequisites section above).

--filesystem exfat

The PIM is a special number that allows you to specify the number of times hashing algorithm executes. It’s a bit more complex than that, if you want full details see the VeraCrypt documentation.

For now, we can pass it the value of 0 (zero), which tells it to use the default value for the PIM.

--pim 0

You can mount a volume in VeraCrypt using a keyfile, as opposed to a password. We’ve not done that here, so we’ll just pass in an empty string to indicate we won’t use a keyfile.

--keyfiles ""

As a final parameter, you need to provide random data for VeraCrypt to use when generating its hashes. It needs at least 320 characters, but you can give more.

I’ve provided a sample one as part of this demo (see the GitHub code samples), I just picked up my keyboard and randomly smacked myself in the head until I got around 350 characters. I’d suggest creating one of your own for production, but for just testing and learning (I’m assuming you’ll throw away the vault when you are done) then the one here will be OK.

As stated in the beginning of this section, either copy the randomdata.txt file into the folder where you are executing the commands from, in my case the Documents folder, or specify the full path to it in the command line.

--random-source randomdata.txt

OK, that’s everything you need to create a volume. Just run the command, or execute the script. Now that it’s created, let’s mount it.

Mounting a VeraCrypt Volume

Here is the full command line to mount. (As before, it should be on a single line, ignore any wrapping done by your browser).

sudo veracrypt --text --mount vctest.vc /mnt --password MySuperSecurePassword1! --pim 0 --keyfiles "" --protect-hidden no --slot 1 --verbose

Let’s start breaking it down. First, as before, is the call to the VeraCrypt app.

sudo veracrypt

As with all of these commands, the --text parameter must come first to let VeraCrypt know we want to use text mode and not the GUI.

--text

The mount parameter actually has two values that need to be passed in.

First we pass in the name of the file to mount.

Second we need to provide a mount point. This will let Linux treat it like any other drive you might plug in. In this example we will use /mnt.

--mount vctest.vc /mnt

Using /mnt works fine if you only have one volume to mount. If not, you’ll have to create new mount points. This is pretty easy.

sudo mkdir /media/vc2

Placing these in the /media area is a common practice. From there you can name it anything you want. You could use vc followed by the slot number, or use the name of the file.

Then in your script, you can use:

--mount vctest.vc /media/vc2

Note that once you create the directory under /media it is persistent, you don’t have to create it again. This does mean your /media will accumulate these mount points over time. Once you are sure you’ll no longer need them consider using rmdir to remove them.

You could of course use /media for all your volumes, and avoid using /mnt completely. Just be aware you’ll have to create a name under /media first.

Next is our “super secure” password. If your password has spaces, you’ll need to wrap this in double quote marks.

--password MySuperSecurePassword1!

If you overrode the default PIM when creating your volume, you’ll need to provide it. Otherwise, we can pass it the value of 0 (zero), which tells it to use the default value.

--pim 0

If you created your volume using a keyfile or files, provide them here. Otherwise, you can just pass in an empty string to indicate no keyfile is needed.

--keyfiles ""

If this volume contained a hidden volume, you would need to let VeraCrypt know by using a value of yes, plus some other parameters.

In this case there is no hidden partition in our volume, so we can just give a value of no.

--protect-hidden no

OPTIONAL – Slot

Slot is an optional parameter. If you look at the VeraCrypt, down the left side are a series of slot numbers. If you omit this parameter, VeraCrypt will mount in the first empty slot.

However you can specify a slot, which can be useful if you want to make sure certain volumes always mount in a specific slot. You can then use the slot number when you want to dismount your volumes.

--slot 1

OPTIONAL – Verbose

Verbose is also an optional parameter, but I often include it just to see what is going on under the covers. You can use it with any of the commands in this post, I just included it on this one for example purposes.

If you intend to make this into a script then I would suggest omitting it once your script is debugged and working.

--verbose

OK, hopefully all is going well, and you’ve created and mounted your volume. Let’s next see how to get a list, from the command line, of all your mounted volumes.

Listing Mounted Volumes

Here’s the command line to see what is mounted on your Ubuntu computer.

sudo veracrypt --text --list

As with other commands you have seen, we start by calling the VeraCrypt application. We then use --text to let VeraCrypt know not to use the GUI.

We finish with --list, which tells VeraCrypt to display a list of all mounted containers. This will include the slot number, volume name, and mount directory.

If you’ve been following along, then running the list should produce an output like:

1: /home/arcanecode/Documents/vctest.vc /dev/mapper/veracrypt1 /mnt

Of course your folder will have your username, not arcanecode.

Mom always taught me to put away my toys when I was done playing with them, so in the next section we’ll see how to dismount your volumes once you are done with them.

Dismounting VeraCrypt Volumes

There are four ways to dismount a volume. Three of them will dismount a specific volume, the final will dismount all volumes.

All methods follow the same pattern. Run veracrypt using sudo, followed by the --text parameter to tell VeraCrypt not to launch the GUI.

Finally we give the --dismount to let VeraCrypt know we want to unload our volume. The value passed into the --dismount parameter varies, and will be explained below.

Method 1: Slot Number

sudo veracrypt --text --dismount --slot 1

With the first method, you provide the slot number. If you mounted a volume and used the slot number parameter, for example your personal file vault is always in slot 5, then this can be an easy way to dismount.

On the other hand, if you let VeraCrypt load in the first available slot, you’ll either have to look at the GUI, or run the list command in the previous section, to learn the slot number.

Be aware there is no requirement to load slots in sequential order. Your first mount could go into slot 5, the second into slot 7, and third into slot 10, leaving the other slots empty.

Method 2: Mount Directory

sudo veracrypt --text --dismount /mnt

Or if you created it under /media, it might look like:

sudo veracrypt --text --dismount /media/vc2

Using the volume list command or looking at the “Mount Directory” column in the GUI, you can pass in that value to dismount. Because you may not always use the same mount point on all systems to mount, it can be of an issue trying to be reliable in dismounting the right volume.

Method 3: Volume File Name

sudo veracrypt --text --dismount vctest.vc

Alternatively you can use the full path to the volume.

sudo veracrypt --text --dismount /home/arcanecode/Documents/vctest.vc

This method is the most reliable. Since you know the name of the file you mounted, you can just provide the same file name to dismount.

VeraCrypt doesn’t care what slot it is loaded into, it uses the file name to find it.

The winner – Method 3!

For the reasons above, I highly suggest Method 3 be your go to method for dismounting volumes in your scripts. It is the most reliable, and easiest to understand when looking at the scripts.

But wait, there’s more!

Dismounting ALL Volumes

There is one final method, you can dismount all of the VeraCrypt volumes you have mounted.

sudo veracrypt --text --dismount

If you use just the --dismount parameter, and pass in no values, then VeraCrypt will attempt to dismount ALL volumes you have loaded.

This can be a useful command to run when you’re shutting down your computer, to ensure all volumes are properly shutdown.

If you don’t have any volumes mounted, then VeraCrypt basically shrugs it’s shoulders, does nothing, and ends.

Conclusion

In this post, we learned how to create, mount, and dismount VeraCrypt volumes from the command line in Linux, specifically Ubuntu. In addition, we also saw how to get a listing of volumes currently mounted.

Advertisement

Formatting A Drive as exFAT on Windows, macOS and Linux

Introduction

In my previous blog post, Sharing a Drive Between Windows, macOS and Linux, I described how to setup the three operating systems to read a drive that had been formatted as exFAT. The exFAT format is readable by all three, and making it easy to share files between different operating systems.

A natural question that follows is, “how do I format a drive as exFAT?”

In this article I’ll show how to format an external drive as exFAT. I’ll be using an 8gb thumb drive, but I’ve used this technique with both thumb drives as well as the larger external multi-terabyte hard drives.

Windows

Windows is the easiest of the three to format a drive for exFAT. First, insert the drive into a USB port. This will typically open the Windows File Explorer, but if not, open it.

Now right click on the drive letter for the USB drive, and click on Format. The format dialog will appear.

In the second drop down you can pick the file system. Use it to select exFAT. You can also enter a new volume label if you want. Simply click the Start button to kick off the format process.

You will of course get a warning that all the data on the drive will be lost, simply click on OK to proceed.

Once done Windows will let you know. Just click OK and your drive is ready to use.

Apple macOS

There’s a few more steps to formatting a drive to exFAT in macOS, but it’s still pretty simple. Start by opening Finder, then go to the Applications. In Applications, open the Utilities folder.

Inside the Utilities, launch the Disk Utility. If you’ve not done so, connect the USB drive you want to format as exFAT.

On the left side of the Disk Utility is a list of drives, click on the USB drive in the list.

Above the drive info area are a series of command buttons. Click on the Erase button. Note you need to click on the icon, not the Erase label.

In the dialog that appears, you can change the label if you wish. The important box is the Format one. You can use the blue arrow to bring up the list, and change it to exFAT.

Once exFAT is selected, you can click the Erase button on the lower right.

Once done, macOS will let you know. Just click Done, and the drive will be ready for you to use.

I’ve used this technique with macOS versions from High Sierra onward.

Linux

For this section, I’m using screen shots from my Kubuntu 20.10 computer. The techniques will work with most Ubuntu/Debian based installs. To make it more portable to other versions, we’ll do most of it using the command line.

Note, these instructions assume you’ve already followed the instructions in my previous blog post, and installed the exFAT utilities.

Start by opening up a terminal window, and entering the following command:

df

Your output will look something like this:

Filesystem     1K-blocks     Used Available Use% Mounted on
tmpfs             805596     1752    803844   1% /run
/dev/sda2      244568380 18388480 213686844   8% /
tmpfs            4027972      128   4027844   1% /dev/shm
tmpfs               5120        4      5116   1% /run/lock
tmpfs               4096        0      4096   0% /sys/fs/cgroup
/dev/sda1         523248     7984    515264   2% /boot/efi
tmpfs             805592      108    805484   1% /run/user/1000
/dev/sdb1        7815648       96   7815552   1% /media/arcanecode/4ECB-E340

For this exercise, I’ll be using the /dev/sdb1 drive which is my 8gb thumb drive.

Before we can proceed, we’ll have to unmount the drive. The command is simple.

sudo umount /dev/sdb1

Now that the drive has been unmounted, we can format it using the mkfs utility.

sudo mkfs.exfat /dev/sdb1

Once formatting is complete, we can check its status using the fsck command.

sudo fsck /dev/sdb1

Your output will vary depending on the drive you formatted, but it will resemble something like this:

fsck from util-linux 2.36
exfatfsck 1.3.0
Checking file system on /dev/sdb1.
File system version           1.0
Sector size                 512 bytes
Cluster size                 32 KB
Volume size                7633 MB
Used space                 3041 KB
Available space            7631 MB
Totally 1 directories and 3 files.
File system checking finished. No errors found.

A benefit of using fsck is that will also remount the drive for you, making it ready to use.

You can verify it again using your systems file explorer. Here I’m using Dolphin, the explorer built into Kubuntu.

Navigate to the drive, right click on it, and pick Properties.

In the properties window it will show you the file system. As you can see, it has been formatted to exFAT.

Conclusion

In this post we saw how to format a drive for exFAT on three operating systems. You can now format a drive using any of the OS’s, and be able to use it across all of them.

Sharing a Drive Between Windows, macOS and Linux

I have a lot of computers, on which I use a variety of operating systems. Some run Windows 10, my Apple macBooks all run macOS, and on others I have a variety of Linux distros, primarily Ubuntu based.

I would like the ability to share external drives, such as thumb drives or external SSD drives, between them. To get that compatibility across OS’s, I need to format those drives in a file format called exFAT.

exFAT is a replacement for the older FAT32, but has the benefits of other file systems such as NTFS. I can have long file names, and store files bigger than four gigabytes in size to name a few.

Windows and macOS both support exFAT out of the box. I can just plug in an exFAT drive into them, and both will let me read and write to them. (Note that not all drives come formatted as exFAT, you may need to reformat them to the exFAT system). Linux, however is another story.

To allow Linux to read an exFAT drive you need to install the exfat-utils utility. On Ubuntu based distros it’s pretty easy, just open up a terminal and enter the following command, all on one line.

sudo apt-get install exfat-fuse exfat-utils

For other distros you can use their native installer, such as yum, to install the exfat-utils. After that you can simply plug an exFAT thumb drive or SSD into your Linux box and it will know how to read and write to the drive.

Getting Started with PowerShell Core on Linux and macOS

My newest course, Getting Started with PowerShell Core on Linux and macOS, is now live on Pluralsight! This course is my eighteenth in a long line of Pluralsight courses.

I begin the course explaining the difference between PowerShell for Windows (version 5.1) and the all-new PowerShell Core (version 6.2 was used for this course), which works not only on Windows but on Linux and macOS as well. I then show how to install PowerShell Core, along with a few other key components such as Visual Studio Code, on both Linux and macOS.

Not familiar with PowerShell? No problem! I quickly cover the basics of PowerShell including cmdlets, the use of the pipeline, how to write functions, and how to put those functions in reusable scripts.

As if that weren’t enough, I show how to do some “cool things” with PowerShell Core, including working with Docker containers, SQL Server, and Azure.

For the course, I primarily used Ubuntu 19.04 and macOS Mojave. The code was also tested on Ubuntu 18.04 LTS and 18.10, as well as macOS High Sierra. In addition, I tested the Linux installs on a variety of distributions including CentOS, Manjaro, and more. The samples include markdown files with information on how to install on these other distributions.

All of the samples are included in the downloadable components of the course on Pluralsight. New with this course I have the samples also available on my GitHub site. As I move into the future the GitHub codebase will be updated with new samples and information.

Also included in the samples are several markdown files that have additional information not included in the course, such as setting VSCode on Windows to use PowerShell Core instead of Windows PowerShell 5.1 as the default terminal.

While you are up on my GitHub site be sure to check out the full list of repositories, I have a lot of examples on it, including some from previous courses such as my recent Reporting Services course. (For a full list of my courses just check out the About ArcaneCode page on this site.)

Note the sample file on Pluralsight will remain static, so if someone watches the course their samples will reflect what is in the course. For the latest updated samples see the GitHub site referenced above.

What? You don’t have a Pluralsight subscription yet? Well, no worries dear reader, just email me, free @ arcanetc.com and I can send you a code good for 30 days with which you can watch all 18 of my courses, plus anyone else’s course at Pluralsight.

Setting Your Ubuntu 18.10 Favorites Bar In A Script

Of late I’ve been setting up and tearing down a lot of Ubuntu virtual machines as part of a PowerShell Core on Linux and macOS course I’m working on for Pluralsight. I wanted to create a script to install everything I need in one fell swoop so I could start testing my PowerShell Core code on a new box.

The one thing that annoyed me though was the Ubuntu Favorites bar on the left. I wanted to be able to add and remove my favorited automatically, rather than manually setting them up each time.

I didn’t think it’d be that hard, but it took a surprising amount of web searching to find the correct answer.

From inside a bash terminal session, you can issue the following command:

/usr/bin/gsettings get org.gnome.shell favorite-apps
(If /usr/bin is in your path, which it likely is, you could omit that part as we’ll see in a moment.) This will produce an array containing a list of your favorites.
['ubiquity.desktop', 'firefox.desktop', 'thunderbird.desktop', 'org.gnome.Nautilus.desktop', 'rhythmbox.desktop', 'libreoffice-writer.desktop', 'org.gnome.Software.desktop', 'yelp.desktop', 'ubuntu-amazon-default.desktop']
I’ve seen all sorts of suggestions on how to update the array, Use Python, Ruby, you could even use PowerShell to rearrange it if you wanted. To be honest though, I took the simple approach.
I just set my favorites manually, one last time. That way I could let Ubuntu tell me the correct application names to use in the background, without having to hunt them down. Once I had them set, I simply ran the gsettings get command (see above) again to get the list of apps, in the order I wanted them.
I then used gsettings again, this time in set mode.
gsettings set org.gnome.shell favorite-apps "['firefox.desktop', 'org.gnome.Terminal.desktop', 'org.gnome.Nautilus.desktop', 'code_code.desktop', 'azuredatastudio.desktop', 'org.gnome.Software.desktop', 'yelp.desktop']"
Just add this to your setup bash script, or enter it at the terminal, and ta-da! Your favorites are now setup like you want.
Naturally all of this is entered as a single line, this is just wrapped here due to space. Also, these are the favorites I want for my situation. Rather than just copy and pasting above, follow my suggestion to set things up manually, then use the output of gsettings get as input for the set.
I have tested this in Ubuntu 18.10, in theory it should work in 18.04 as well. I would imagine it would also work in 19.04 when it’s released, I’ll come back and update this post once I’ve had time to test it.

Installing Ubuntu 8.04 under Microsoft Virtual PC 2007

Update: Nov. 10, 2008 – New blog post on installing Ubuntu 8.10 is now out: http://tinyurl.com/vpcubuntu810

I’m pleased to say that Ubuntu 8.04 is probably the easiest install I’ve had to do with VPC yet! One quick reminder before we begin, when working inside the VPC your mouse will get “trapped” or captured by the virtual computer. You won’t be able to move outside of it. To get it released, just press the RIGHT side ALT key. Left side won’t work, has to be the RIGHT side of your keyboard.

To start with, create a new Virtual PC. For a tutorial, see either my step by step tutorial or the video tutorial if you need more instructions. Since I had the space, I was using 768 meg of ram, and left the disk space at the default of 16 gig. If you can, try and use at least 512 meg of ram for good performance. Use the CD menu option to capture the desktop ISO you downloaded from Ubuntu, or if you have a real CD put it in the drive and capture that. When it launches, you’ll see this screen. (By the way, you can click on any of the screens to see the full size graphic, these have been resized slightly to fit in with most common browser sizes).

[image - Select Language]

Pick your language, I just took the default of English.

[image - Safe graphics mode]

Now press F4 to select an alternate starting mode. When it pops up, change to Safe graphics mode, as you see above, and press Enter. Now pick “Try Ubuntu…” (should already be selected) and press enter. Do NOT pick the Install Ubuntu option, I kept getting VPC errors when trying to install directly.

Additionally, don’t be alarmed if the screen goes black for a while, then you see some garbled graphics. This is perfectly normal, it is just passing through and will be OK when Ubuntu gets done doing it’s thing. It took me about 7 minutes to get from the previous screen to the next one.

[image - live environment]

After it boots you should be in the live session trial environment. Double click the Install icon to begin the install process.

[image - Installer welcome screen]

Screen 1 is just a welcome screen, although you can change your language here if you need to. Press Forward to continue.

[image - Installer Set Time Zone]

Next it wants to know where you are, at least time zone wise. I’m in the central time zone, but set yours appropriately and click Forward.

[image - Installer Pick your Keyboard]

Next you can specify your keyboard. Since I’m using a typical USA style keyboard, I just clicked Forward.

[image - Installer Prepare Disk Space]

Next it asks how you want your disk space partitioned. Since we’re in a virtual environment, it made the most sense to just take the defaults and click Forward.

Be aware, after clicking forward my mouse went into the “I’m busy” mode, and there was a delay while the disks were prepared. Mine went about five minutes. Don’t be alarmed, just wait a few minutes and you’ll then proceed to the next screen.

[image - Installer Who Are You]

On this screen, first supply your name; this will be used in documents and the like. The next text box is the important one – it is for your Ubuntu user name. By default it uses your first name, now is your chance to change it. I rather like mine so will accept it. Next you’ll need to key in a good password and confirm, and finally name the computer. When you are happy, click Forward.

Now is where you may get confused. In the screen above, you are on step 5 of 7. When you click forward, you are suddenly on step 7 of 7. I’m not sure what happened to step 6, I even ran the installer yet one more time just to make sure it was gone. Perhaps it was kidnapped by space aliens?

[image - Installer is Ready]

Apparently even without the missing step 6, the installer has everything it needs. Just click Install to begin the install process. Kick back and wait. Don’t be alarmed if the screen goes black during the process, it’s just the screen saver kicking in. Just click in the VPC and wiggle your mouse and your display will return. I had it kick in several times during the 45 (or so) minutes it took to get everything installed.

[image - Install complete time to reboot]

Eventually Ubuntu will complete it’s install, then give you the above message. On the Virtual PC menu click CD, then release the cd. Then click on the big Restart now button inside VPC.

This was the only real snag I hit in the whole install process, I waited a while and it never did restart on its own. I gave it about five minutes, then in the Virtual PC menu I clicked Action, Reset. I figured since it’s already installed, I wouldn’t lose anything, and I was right.

The boot process does take a few minutes; you’ll see some text then a black screen for about 90 seconds. Then it comes up to the big Ubuntu logo and the orange bar as it loads. You’ll see some garbled graphics for a few seconds, then the login screen finally appeared. I gave it my user id and password, and minutes later I was in Ubuntu.

One last piece of business, fixing the networking. First make sure the network card is mapped to a real network card in your computer. For more instructions on this, see my video, Virtual PC Advanced Settings. After that, click on the network icon in the upper right side of the toolbar, as you see below.

[image - Fix Networking]

Then just pick Wired Network. Once connected you’ll be free to visit your favorite websites!

[image - Ubuntu open for business]

I haven’t had much time to check out other features, or get the sound working so if anyone has a quick fix for that by all means leave a comment below.

Installing Ubuntu 8.04 Beta under Virtual PC 2007

Update: April 24, 2008 Today Ubuntu 8.04 was released, and it’s a much easier install. Ignore the directions below, and instead jump to my post for April 24th, 2008 – Installing Ubuntu 8.04 under Microsoft Virtual PC 2008.

Like a lot of folks I was interested in working with the latest Ubuntu. However, I had some real issues getting it installed under VPC. On the good news side the pesky mouse problem is gone, apparently the kernel got updated to fix the mouse bug that plagued us with 7.10.

A quick disclaimer, the instructions below were created using BETA software. As new betas trickle out, or the final version is released, some of the things here may or may not work for you.

I do have some bad news. Attempting to install the standard desktop version, when the install got 6% into the Partitioning phase the VPC either locked up, or crashed all together with an unrecoverable error. Now for the good news, I did find a way to get Ubuntu 8.04 Beta installed, but it took some work on the post install to get the display to work. Hang with me though and I’ll show you the steps.

First, you need the right bits. Go to the http://www.ubuntu.com/testing/hardy/beta website . Scroll past the download area and find a mirror that is appropriate to your area. I chose http://mirrors.easynews.com/linux/ubuntu-releases/8.04/ as I live in North America, but all of the pages look the same.

Once on the mirror site, scroll down past the Desktop area, down past the Server section, until you find the “Alternate install CD” area. That’s the one you want! I used the one for the PC Intel platform.

OK, fire up Virtual PC 2007 and create a new machine, I’ll assume you are familiar with VPC and won’t recreate those instructions here. Only note I’ll make is to make sure and pick ‘Other’ for the OS, and for memory you need at least 256 meg of ram for Ubuntu, 512 would be better. Of course if you have more, feel free to bump it up to 768 or even 1024. Since I had the available ram I used 768.

Boot the machine, and use the CD menu to mount the Alternate Install CD ISO that you had downloaded. After it boots you’ll see this screen:

clip_image001

Just press Enter to continue to the next screen.

clip_image002

Again, all we have to do is press Enter to continue.

clip_image003

Now select your native language. Since mine is English all I had to do is press Enter.

clip_image004

After picking my language, Ubuntu further wants to narrow in on where I live by asking about my country. I picked my country and pressed Enter.

clip_image005

Next Ubuntu wants to detect my keyboard. If you want you can go through the default of Yes, and walk through a series of screens where you press a letter on your keyboard, or tell it you don’t have that key. Frankly I found it much faster just to tell it what kind of keyboard I had, and picked No and pressed Enter.

clip_image006 

Now it’s asking what the origin country of my keyboard is, since mine is USA (the default) all I had to do is press Enter.

clip_image007 

Next I’m asked what keyboard type. If you want to use something different (I know a few fans of Dvorak) you can pick those, but since I’m using a standard keyboard, I just went with the default you see above and pressed Enter. A

After doing so, the installer went through a series of screens where it was doing a lot of scanning of my (virtual) system and installing various components. It took about 10 to 15 minutes to get to the next screen.

clip_image008 

Here we are asked to give our system a name as it will be known on the network. The default name is ubuntu, but I modified it to what you see above so it would be unique. I would advise you to do the same, in case you wind up running your VPC on a network with others. Once you name your system, tab to Continue and press Enter.

clip_image009 

On this screen you are asked what time zone you live in. I live in the great state of Alabama, which is in the Central time zone, select the time zone for your state and press Enter.

clip_image010 

Next we are asked about partitioning the drive. I just took the default that you see here and pressed Enter.

clip_image011 

Now Ubuntu wants to make sure we understand that it’s about to wipe out what’s on the drive. Since it’s just a virtual drive, that’s fine we can safely press Enter to continue without risking any damage to our host ‘real’ hard disk.

clip_image012 

Ubuntu wants to make sure we really understand it’s about to wipe the drive and create two partitions. It even makes the default No. Change the answer to Yes, and press Enter. At this point a rather long process begins, on my system it was around fifteen to twenty minutes. Your time may vary depending on your system speed and hard disk speeds.

clip_image013 

Now we are asked for our full name. I just entered my nick name here, but you can put your full name if you wish. This will not be your login, but just used as the initial default in e-mails and the like. Once you enter a name, tab down to Continue and press Enter.

clip_image014 

OK, now it is asking you what name you want to use for a login / user ID. Make sure you pick something good as you may be keying this often. By default the installer takes your first name and lower cases it. That’s fine for me, so I’ll just press Enter to continue.

clip_image015 

Next you are asked for a password. Enter a good password, tab down to Continue and press Enter. On the next screen, which I won’t bother to show you as it looks almost identical to this one, it asks us to retype the password. Do so, again tab down to Continue and press Enter to proceed to the next screen.

Ubuntu will do a short install, then show you this:

clip_image016 

Ubuntu wants to find out if you need to use a proxy server. If you do, enter it here. Most people do not, so all you have to do is tab down to Continue and press Enter.

One last question from Ubuntu, asking about the system clock:

clip_image017 

While it’s true many servers are set to UTC, most home machines are not, so I took the NO option and pressed Enter. On my system it took about an hour before I got to the next screen. It didn’t hang up through most of it until the very end. It stayed at 97% – Cleaning up… for quite a bit. But eventually it moved on to the next screen.

clip_image018 

OK, you may think this is the finish line, but not quite. We still have to edit two files before we can use the system, otherwise we wind up with garbled graphics. When you press Enter on the screen above to reboot, look very carefully at the screen during the reboot. When you see the line:

Grub Loading Please Wait…

Immediately press the ESC key, and you should see this menu.

clip_image019 

Change the menu to the second option and press e to edit the line. This will bring up the next screen.

clip_image020 

Move to 2nd line and press e to edit. At the end of the line, add a space then vga=791 . Press Enter to save the change, which returns you to the above screen. Now press b to boot. The system will work, the screen may even go black for a minute, but eventually you will bring you to the following display.

clip_image021 

Change option to root – drop to root shell prompt, tab to OK and press Enter. This will drop you to a command prompt.

clip_image022 

At the command prompt, type sudo nano /etc/X11/xorg.conf and press Enter. This will bring up the nano editor, and let you edit the file that controls system settings.

Scroll down until you find the section titled Section “Screen” . At the bottom add the line DefaultDepth 16 as you see in this snapshot:

clip_image023 

I put spaces, not tabs between DefaultDepth and 16. Once done, press CTRL+O (that’s the letter O, not a zero) to writeOut the file, then CTRL+X to close the editor.

OK, one more file to edit. Now type in sudo nano /boot/grub/menu.lst as you see in this screen snippet, and press Enter.

clip_image024

Now scroll down to the very end of the file. What we are looking at is the menu that appears when you press the ESC key on the GRUB loader. We are going to modify the first item, which is the default, to boot in VGA 1024×768 16k color mode.

Find the first line that says kernel at the end of the file (see where my mouse is pointing in the screen capture below.

clip_image025

Hit the END key to go to the end of the line. The line ends with quiet nosplash. Remove those two words and replace them with vga=791 , as you see below.

clip_image026

Hit CTRL+O (that’s the letter O for writeOut) to save it, then CTRL+X to exit the nano program. When you are returned to the command prompt, type in sudo reboot and press Enter to reboot Ubuntu.

This time, don’t press anything at the grub menu, just let it load. What I found was during the boot you wind up with a black screen that lasts about one minute, but if you carefully observe you’ll notice your drive light flashing. It then returns to a text screen, and eventually you are presented with a pretty screen asking you to login.

clip_image027

Enter your user name and press Enter, then on the next screen type in your password and press Enter again. And after a minute or two of churning… TA-DA!

clip_image028

I’m still looking into things like networking and sound, but at least these instructions will get you up and running with the Beta.

As I said at the beginning, these instructions are based on BETA code. When the final version is released sometime this month things may or may not change. Feel free to post your experiences in the comments area, along with any tips you may have on getting up and going with things like networking and sound.

See, I TOLD you Apple is the Evil Empire

Some time back, I wrote a blog post describing Apple as “The Evil Empire”. Now a nationally known figure is adding her voice to the chorus. In this CNet Buzz Report, Molly Wood describes Apple as her “bad boyfriend”. They The guy who forces her to look good, tell her what cell phone carrier to use, etc without caring about her.

I thought that was a pretty apt description, and it really helps delineate the differences between the Apple philosophy and everyone else. Apple keeps tight control over their domain. Who cares if the new Air only has 1 USB, no firewire, no internet, no optical drive, no media card reader, and no expansion slots? Hey it LOOKS good. And those pretty new i-Phones? Oh, you can only use the carrier THEY pick out for you. Third party apps? Only if they give their blessing, which they still haven’t done. But hey, it LOOKS good.

Contrast that with both Windows and Linux. You can run the OS on any machine you wish. Windows Mobile? sure, any company who wants to license it for their device or carrier great with them. Heck Microsoft was even so open they let the i-Phone work with Exchange. But people complain that Microsoft isn’t open enough? And after Apple’s latest stunt of trying to force Safari down everyone’s throats via the iTunes update, I’d better not hear any Mac-Head deride the Windows Update process as “sneaky”.

It’s no wonder people are resorting to installing Windows on their MacBooks, it’s the only way they can get the freedom to get any work done!

Installing Kubuntu 7.10 In Virtual PC 2007

After last weeks post on Ubuntu 7.10 (https://arcanecode.wordpress.com/2007/10/18/installing-ubuntu-710-under-virtual-pc-2007/), I had several requests for Kubuntu. Since I’m happy to please, here are the step by step instructions for Kubnutu. By the way, I’ve reduced the screen sizes a little to make them fit the flow of the blog, but you can click any of them to see them in full size should you need to make out any of the details.

If you haven’t already done so, you’ll need to download the latest image of Kubuntu, you can get it from http://www.kubuntu.com/download.php .

Kubuntu has some of the same issues as Ubuntu under Virtual PC when it comes to graphics and the mouse. When you fire up the VPC with the Kubuntu disk in the drive (or you’ve captured it’s ISO image), you’ll want to move the highlight down to “Start Kubuntu in safe graphics mode”. To fix the mouse, at least for this session, press F6 for boot options, and type in “i8042.noloop” after the –. Once your screen looks like the one below, press Enter to continue.

k710_001

Once Kubuntu boots, click the install icon on the desktop to begin the installation process.

k710_002

On the Welcome screen, just confirm your language, then press Next.

k710_003

In this step you get to play Carmen whats-her-name and do the “Where in the world are you” bit. Select a city in the time zone in which you live, then click Next.

k710_004

Now pick your keyboard, and click Next.

k710_005

On the disk space screen, just take the defaults and click next.

k710_006

OK, now we actually have to do some work, and give Kubuntu some info. Make sure to remember your password, not only will you need it to login but you’ll also need it for any commands that need super user privlidges.

k710_007

OK, Kubuntu finally knows everything it needs in order to install so just hit next.

k710_008

And wait. And wait. And wait. If you thought Ubuntu took a while to install, just wait for Kubuntu. My experience was a couple of hours, but to be fair I was also playing a couple of Quicktime videos (some of the cool shows from http://www.revision3.com) and testing an openSuse install in another VPC. And I have sloooooooooooow hard disks, so your milage (or kilometers) may vary. But it’ll still take a while.

About 84% or so into it I got this error. This is similar to the error I got with Ubuntu, just click OK to let it keep going. Oh, and wait some more.

k710_009

Yea! It finally finished the install.

k710_010

When you get to this screen, just press OK, then reboot Kubuntu. Don’t forget to eject the CD (or release the ISO) during the reboot. But before you press OK, make sure to read the next step!

OK, time for a tricky part. Pay close attention during the reboot. When you get to the screen that talks about the GRUB menu, press the ESCape key. You should see a screen like this:

k710_011

With the top line highlighted, press the e key to edit the command line.

On the next screen, press the down arrow once to highlight the line that begins in “kernel”, then press e again to edit that line. When the edit screen appears, we need to add the – i8042.noloop to the end of the line. It should look something like:

k710_012

Press Enter, then when you return to the screen with “kernel” on it, press ‘b’ (just the letter b) to boot Kubuntu. What this will do is enable the mouse for this session only! Once we get booted, we’ll fix the mouse permanently, so hang on.

When the login screen appears, enter your user name and password (the ones you entered on the “Who Are You” screen during the installation) and press enter. Now give it a minute while Kubuntu finishes loading.

OK, now it’s time to fix that pesky mouse issue once and for all. Click on the big K in the lower left (it’s like the Start button in Windows), and go to System, then bring up Konsole.

k710_013

Now in the Konsole window, type in

sudo kate /boot/grub/menu.lst

and press enter.

k710_014

Enter your password when prompted, and you should be in the kate editor. Note you may see a few errors on the terminal window. These can be ignored.

Once kate is up, scroll to the very bottom of the editor where you’ll find three sections of “title… kernel… “ etc. In the first section, which is the default, we need to edit the kernel line to add:

— i8042.noloop

to the end of the line, as you see here. Once done, save it by using File, Save on the menu or clicking the floppy disk. Then exit kate (File, Quit) and exit the terminal window (type exit and press enter, or close by just clicking the x button as you would in Windows).

k710_015

And that’s it, you should be good to go and enjoy Kubuntu 7.10 virtually.

PS If you found this useful, please give it a digg so others can find it too.

Installing Ubuntu 7.10 Under Virtual PC 2007

Update April 24, 2008 – The newest version of Ubuntu, 8.04 is out. Look for complete install instructions here.

Update April 7 2008 – If you are interested in also playing with the 8.04 BETA, you can read my post here.

Ubuntu version 7.10 was just released. In keeping up with tradition I’d like to describe step by step instructions on how to install and get it running under Virtual PC 2007.

Before I begin though, I’d like to give a word of thanks to all the folks who have commented on my previous postings. It was their findings and efforts that helped to create this work, I owe them a big thanks.

OK, first thing you need is to download the Desktop install ISO from the Ubuntu site (http://www.ubuntu.com). You can skip right to the download mirrors page at http://www.ubuntu.com/getubuntu/downloadmirrors if you want to save a few mouse clicks.

Once you get it downloaded fire up Virtual PC, and create a new machine. If you are not familiar with VPC, see my step by step instructions for creating a machine at https://arcanecode.wordpress.com/2006/09/20/virtual-pc-step-by-step/ Make sure to pick “other” as the OS type. I used 512 meg of ram because my system has 2 gig, but if you have less you can get away with 256 meg of ram for the Ubuntu Virtual machine.

Fire up your new virtual machine, and use the option in the CD menu to “Capture ISO image”. Point the image at the desktop iso you just downloaded.When it starts, immediately press the down arrow, so that “Start Ubuntu in Safe Graphics Mode” is highlighted.

When 7.04 was released, the new kernel had issues with the mouse emulated by Virtual PC. To be blunt, the mouse just didn’t work. However, several work arounds were found. The easiest was brought to my attention via comments on the blog, the i8042.noloop option. That’s what we’ll implement, so we can use the mouse during the “live mode”.

Hit the F6 key, for Options. When the line appears, at the very end type in a space (if there’s not one after the two dashes) then i8042.noloop . Your screen should look something like this:

u710_001

Press Enter to start the launch process. Be patient, it takes quite a while. Once it’s finally up though, you’ll see this screen:

u710_002

Double click on the Install icon to begin the install.

On the first screen, below, you are welcomed and asked about a language. Pick your language and hit Forward.

u710_003

Now pick your time zone, since I’m in the Central zone I picked Chicago as a city in my time zone and clicked Forward.

u710_004

No it asks about keyboard layout, pick your keyboard if yours isn’t US English, then press Forward.

u710_005

Ubuntu will crank and grind for a minute, then you’ll see this dialog asking about your disks. Just take the defaults and click Forward.

u710_006

Time for a little personal info, give your name, a login id, enter the password you want to use, and what you want to name the “computer”. When done click Forward.

u710_007

OK, you’re almost ready to start the install process. Look this over, if everything looks good just press the Install button and we’re off to the races.

u710_008

Did I say races? Well, turtle race might be more like it, the install runs pretty slow, so get some coffee, or maybe a second bowl of ice cream if you’re doing a late night install.

u710_009

I did encounter one error during the install. You may see this as well, but you can go back later and correct this through the normal updates process.

u710_010

Now Ubuntu will finish, and ask if we want to reboot. Tell it no, then reboot by shutting down by pressing the red shut down icon in the very upper right of the Ubuntu window.

OK, you’ll have to be very quick with this next step. Remember the mouse issue? We’ll still need to fix it. First, boot the new machine, after clicking on CD and releasing the ISO if it’s still held. Now when you see the words “Grub loader” hit the Escape key. If you were fast enough, you’ll see this screen.

u710_012

With the line you see selected, press the “e” to edit the line. Now a new screen will appear.

u710_013

Move the highlight down one to the Kernal line, and press “e” to edit that line. When the new screen appears, you’ll need to add two dashes, then the i8042.noloop command. Your screen should look like this:

u710_014

Press Enter, then when you are returned to the screen with “kernel…” on it, make sure the kernel line is still highlighted and press b to boot.

Once booted, login using your user id and password. When Unbuntu is up, it’s time to fix the mouse issue once and for all. Click on Applications, Accessories, Terminal. When the terminal window appears, type in:

sudo gedit /boot/grub/menu.lst

u710_015

When you press Enter you’ll be prompted for your password, enter it. An editor should appear. Scroll down to the very bottom of the text and find the line that begins with “kernel”. Add the – i8042.noloop to the end of the line, as I’ve shown below. (Note I have highlighted the line to make it easy to see, yours won’t be normally highlighted in your session.)

u710_016

Save the file and exit the editor and the terminal window. When you next reboot, you should be able to just login normally, and the mouse should work.

And there you go, Ubuntu 7.10 up and running, complete with mouse, under Virtual PC 2007.

P.S. If you found this post useful, please give it a Digg so others can find the same happiness you did.

Microsoft Goes Open Source

For years critics have been blasting Microsoft over their proprietary standards and applications. Over the last few years, however, Microsoft has slowly been answering those critics by adopting internet standards instead of insisting on their own, and releasing more things to the community.

The ability to save Office 2007 documents as XPS comes to mind, as does the ability for CardSpace to use open standards like OpenID. Now, in their next step they are embracing the open source community through the addition of a new Open Source page within Microsoft.

http://www.microsoft.com/opensource/default.mspx

On this site you can find all sorts of information and resources for those wanting to do open source projects using Microsoft software. Links to articles, websites, and the Visual Studio Express editions can be found. I won’t try to reiterate the entire site here, but if you have an interest in Open Source it’s well worth your time to have a look.

In addition is another site called Port 25. It is the outreach site for Microsoft’s Open Source Software Lab. Some really cool stuff here on Linux interoperability, as well as the new Dynamic Language support such as IronRuby and IronPython.

http://port25.technet.com/

I can tell right now I’m going to be spending a lot of time on Port 25.

Finally, I should mention a site that’s been around for a bit by the name of CodePlex. It’s Microsoft’s site to host open source project done by both Microsoft folks and those of us in the community. (Well, I say us, one day I keep swearing I’ll find time to crank out some cool project and put it on CodePlex.)

http://www.codeplex.com/

Currently they show about 2000 projects right now, so there should be a lot for you to check out.

No, I don’t foresee Vista going open source anytime soon. But I really have to hand it to Microsoft. Somewhere over the last few years they realized they weren’t the only game in town. Since then they have really made an effort to “play nice” with other communities, and embrace many new open standards. The creation of their Microsoft Open Source site is just another step in that journey.

Fixing Ubuntu 7.04 Fiesty Fawn Mouse under Virtual PC 2007

Update: October 18, 2007 – Ubuntu 7.10 was released today, and I’ve now posted step by step instructions for installing it. If you haven’t yet installed Ubuntu, you may prefer to start with the instructions on 7.10, found here: https://arcanecode.wordpress.com/2007/10/18/installing-ubuntu-710-under-virtual-pc-2007/


OK, one of my readers “John” (thanks John!) shared a link to an unsupported patch that fixed the Ubuntu 7.04’s mouse under Virtual PC. Let me give you the quick summary of what I did:

  1. Fired up a new VirtualPC with the Fiesty Fawn “Live CD” in the drive. Booted up in safe graphics mode.
  2. Once up, I activated the keyboard mouse using the fix I described in my post “Ubuntu 7.04 and Virtual PC 2007 – Mouse Issue Workaround (sort of)” at http://shrinkster.com/p2u.
  3. I then installed Ubuntu, it was pretty straightforward although a bit annoying using the numeric keypad as a mouse. One hint, sometimes it didn’t recognize my mouse click until I moved the mouse off a button then back on.
  4. After the install I rebooted, then in my new install repeated step 2 to activate the keyboard mouse in my new install. Setting this in the Live CD didn’t carry over to the new install.
  5. I then opened firefox and went to the link John provided, https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/87262/comments/13. Since that’s a lot of typing, I shrinksterized it to make it very easy to type, http://shrinkster.com/p2t.
  6. Joe Soroka has posted a script, I downloaded it using the “shell script” link at the very top of the message and saved it to my home folder.
  7. I opened my File Browser (use Left Alt+F1 select Places, Home Folder). I moved the mouse (again using the numeric keypad) and clicked once on the sh file I’d saved.
  8. Now in the browser, with the file highlighted, hit left alt+enter or select File, Properties on the File Browser menu.
  9. In the dialog that appears, move to the Permissions tab, and check on the box that says “Allow executing file as program”. Click the close button to close the dialog.
  10. Now double click the sh file or press enter. You should see a dialog appear that asks if you want to open in a text editor or run the script. Select the “run in terminal” option. (Update, added “in terminal” based on feedback.)
  11. While the script executes it will ask for your admin password, give it.
  12. At one point it will also stop to ask if you want to skip or configure grub manually, or let it do it for you. I pressed enter to let the script do it for me.
  13. That ended the app, when the terminal window closed I rebooted (still using the numeric keypad as my mouse).
  14. When Ubuntu came back up, it flashed a quick message from the grub asking which kernel I wanted to load, I just took the default.
  15. I logged in and what do you know, my mouse worked!

Just FYI, I’m running Virutal PC 2007 under Vista, using the standard desktop version of Ubuntu 7.04.

The real hero here is Joe Soroka for posting such a simple fix. I encourage you to give it a try. If you are concerned about messing up your Ubuntu install, simply copy the VHD/VPC files to a backup location before running the fix.

A big thanks to Joe Soroka, and to “John” for posting the link. Now I can actually start playing with Ubuntu 7.04.

BOHICA

I mentioned I was on a business trip, during our long road miles my co-worker and I listened to quite a few podcasts. One that was really interesting is the current episode of Security now, episode 91. (http://www.twit.tv/sn91).

In this episode Steve and Leo interview Marc Maiffret of eEye Digital Security (http://www.eeye.com/html/index.html) about the state of security both in the Enterprise and at home. In this episode Marc makes a starting yet fascinating assertion, namely that Microsoft Software is no longer the biggest vulnerability on the Windows platform. Instead, their research shows it’s other software that’s opening up vulnerabilities.

Part of the issue occurs because these vendors lack the concept of “Patch Tuesday” that MS has. Additionally, they tend to bundle their security fixes with other software updates. A user looks at a 47 meg update and goes “hmm, my app is running fine, don’t see a need to update” and misses all the security fixes.

Now, before some joker comes off with “run Linux it’s secure”, on a recent episode Steve talked about a Javascript exploit that can affect your router and effectively open it up. And yes, the exploit works on both Windows and Linux and it also runs under FireFox as well as IE. (Please note I’m not bashing Linux, I have it on a few of my boxes, I’m just realistic about its security abilities.)

The point I’m making here is to make sure to update ALL of your software. Like many I dutifully have my Microsoft updates run automatically each week, but have declined updates of other software thinking “nah, it’s working right now not gonna worry about it”. You can bet I won’t make that mistake again!

Ubuntu 7.04 and Virtual PC 2007 – Mouse Issue Workaround (sort of)

Update: October 18, 2007 – Ubuntu 7.10 was released, the install for it is a bit more straight forward. If you haven’t installed 7.04 yet, I’d suggest giving 7.10 a try. Complete instructions here:
https://arcanecode.wordpress.com/2007/10/18/installing-ubuntu-710-under-virtual-pc-2007/


Update: A reader named John posted a link to a fix, see my post on May 17 (http://shrinkster.com/p2w) for full details. But keep reading this post, as you’ll need the info here to implement the fix. OK, thanks to a suggestion I saw on the Ubuntu forums, I found a workaround for the no mouse issue, of sorts. This won’t give you the mouse back, but it will let you use Ubuntu 7.04 using keyboard control.

First, let me take a second to explain what the issue is. There was a bug in the kernel code that affected many different distros of Linux. Apparently the kernel was not finding PS/2 style mice. Some work has been done and now most PS/2 style mice are now being found.

Except, sadly for the ones being emulated. Both VMWare and VirtualPC emulate a PS/2 style mouse, and are not getting found by the kernel. Remember, it doesn’t matter what type of mouse you have hooked up to the host box (I have two mice, a Logitech MediaPlay and Microsoft Travel mouse, both USB). It only matters what the virtual machine is telling the guest OS (Ubuntu), which is PS/2 style mouse.

OK, that explained let’s play with Ubuntu some. Fire up Virtual PC, then use the CD menu to either capture an ISO image or capture the CD Drive you have the Ubuntu Desktop disk in.

When the menu appears, select “Start Ubuntu in Safe Graphics Mode” by hitting the down arrow once and pressing Enter. If you fail to do this, you’ll get garbled graphics.

Once Ubuntu gets fully loaded, press the left ALT key plus F1 (Left ALT+F1, remember VPC takes over the right ALT). This should highlight the Applications menu. Press the right arrow twice to System, then down once to Preferences. Now press the right key once to get to Accessibility, then right again. Finally go down to Keyboard Accessibility and press ENTER.

[Picture of Ubuntu 7 menus]

When the Keyboard Accessibility Preferences window appears, you should already be on the “Enable keyboard accessibility features”. (You can tell you’re on it because of the little ‘dancing ants’ rectangle around it.) Just press the SPACE BAR to check this on, as you see below.

[Picture of Keyboard Accessibility window]

Now press the TAB key to get on the Basic tab. Press the RIGHT ARROW key twice to get the Mouse Keys highlighted.

[Picture of Keyboard Accessibility window]

Press TAB again to get to the “Enable Mouse Keys” and press the SPACE BAR to check it on. Now tab on down to the Close button and press ENTER.

What you just did was turn the numeric keypad into your mouse. When you press left (number 4 ), the mouse moves left, press the up arrow (number 8 ) mouse goes up, and so on. The angles work, pressing 7 (the home key on my keypad) moves up and to the left, for exampe. Finally, the number 5 key works as the mouse click.

One thing to be aware of, these only work with the numeric keys. It will not work with the standard arrow keys. Laptop owners with compact keyboards are in for a painful experience, you’ll have to hit NUMLOCK to activate the mouse, then turn Numlock off to be able to type letters again.

Well there you go, a way you can use Ubuntu 7.04 in Virtual PC 2007. Not the greatest solution, but might work for you until the kernel issue gets fixed.

I’d like to give credit where it’s due, in reading through the Ubuntu forums I saw someone suggest using keyboard accessibility to work around the no mouse issue. After playing with it some, I decided it was worth documenting and hence this post. I’d like to give credit but haven’t found the original post since then, so if someone happens to notice it in the forums please let me know so I can give credit for the idea to the original poster.

Ubuntu 7.04 and Virtual PC 2007 – No Mouse Issue

Update: October 18, 2007 – The new version of Ubuntu, 7.10 is now out. If you haven’t yet installed Ubuntu, I’d suggest using 7.10. I have step by step instructions at https://arcanecode.wordpress.com/2007/10/18/installing-ubuntu-710-under-virtual-pc-2007/


Last week the folks at Ubuntu released Fiesty Fawn, better known as version 7.04 of the Ubuntu OS. I had planned a new version of the “step by step” to detail how to install under VirtualPC 2007.

Sadly there seems to be a severe error that prevents 7.04 from running in Virtual PC. This error lies somewhere deep in the kernel, and affects the mouse. As you have discovered, Ubuntu won’t recognize the mouse when running inside VPC.

This was actually a much more serious error at first, Ubuntu and several other Linux distros had errors recognizing most PS/2 style mice, as you can see from this bug: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=223606

They have opened a new bug specifically for Virtual PC, which you can monitor here: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=234348. (Credit due alert: Thanks to Michael Wexler for first pointing out these links!).

I’ve spent quite a while trying various combinations, but thus far have found no easy solution or workaround to the problem. So for now, my advice is simple.

If you have an existing Ubuntu install under VPC, I recommend you NOT upgrade. You will lose your mouse for sure, and probably keyboard as well. If you want to experiment, start with a fresh virtual machine and go from there.

In the meantime, keep an eye on the second bug I listed. I’m hopeful there will be an update in the near future. At that point I’ll work up some step by step instructions, which should be pretty similar to the 6.06 instructions.

Update: (April 25th, 2007) – I found a work around (of sorts) that will let you use your numeric keypad as a mouse. Not the most pleasant experience, but it does work. See my post on the 25th ( http://shrinkster.com/ocx ) for full details.