Archive for Troublesolving

VMware Magic - Live conversion of a physical Linux machine to a virtual machine!

// August 12th, 2009 // No Comments » // Linux, Tools, Troublesolving, Ubuntu, VMWare

I can’t tell you how many times VMware has amazed me throughout the years. It (and others like Microsoft Virtual PC) has come a long way in the recent years due to the increasing popularity and demand of virtualization solutions. I use virtual machines every day. At home I have VMware Fusion on my Macs for the occasional excursion into Windows and at work we use it both on our servers and I personally use it on my desktop to try out new things like Win7. OK, enough of praise for virtual machines. You are probably already sold on them yourself!

I am in the process of reconfiguring my “server stack” at home. My primary server is a Linux (Ubuntu) machine that I’m going to do terrible things to. I’m going to install Windows Home Server (WHS) on it!? This is mostly for the very cool feature “Drive Extender” that let’s you combine a bunch of hard drives into a single partition and still have a acceptable level of redundancy. To my knowledge there is no other solution quite like it. RAID can be good in some instances, but I want to try WHS and Drive Extender. But since the Linux machine is my primary server running a lot of important stuff I need it to be available 24/7. I will also need it even if I decide to keep the WHS as my primary server since I don’t want to convert all my Linux stuff to Windows.

So I set out to see if there was anyway I could convert the physical Linux machine into a virtual machine, with no downtime on the Linux machine. Enter the very cool product “VMware Converter”! This is free software from VMware, and with it I should be able to convert my live running machine into a virtual ditto with no downtime! That almost sounded to good to be true, and for some parts it was! :-)

I started by installing VMware Converter on my Linux machine. This posed no problems at all. I fired it up and selected my Linux machine as the source and tweaked a few settings. But when I got to the “choose destination” part of the conversion I hit a brick wall. It turns out you need a VMware ESX server as the destination to be able to do a live conversion of a running Linux machine. You can’t do the conversion into VMware Server or just into a VMware image. I honestly don’t know the reasons for this. Perhaps VMware just want it to be a “enterprise” feature (and make you pony up some cash). Anyway, I was about to give up at this point. Then I discovered that there is a free version of ESX called ESXi. Since I had never tried to set up an ESX server, and it was free, I decided to give it a shot and try to install it. By the way, VMware ESX is a product that runs nativly on your hardware without any operating system. You can then run virtual machines on the ESX server.

To install ESX you need a separate server. I have lots of old computers lying around, so I choose one of them and tried to install ESXi. First problem was that ESXi only supports 64bit systems. So I had to download an older version that supported 32bit. It then quickly turns out that ESX needs at least 1 gig of RAM, and my old horse only had 0.5. So I picked another computer that had 3 gig of RAM. This was a DELL machine, and ESX started to whine about a BIOS setting called “CPUIDLimit”. Apparently it wanted me to change this setting, but the DELL BIOS hides it. 10 minutes of google and some headache solved that problem. Basically you need to halt the boot sequence of ESX and enter the parameter nocheckCPUIDLimit. After that, everything installed just fine. I now had my first ESX server up and running!

From here on it was a simple process! I just fired up VMware Converter, selected the running Linux machine as the source and the ESX server as the destination and everything went perfectly.

If you have yet to try the stuff described in this post I can really recommend diving into it! Best of luck and keep Google (or perhaps Bing?) close by and all should be well. :-)

Solving Visual Studio’s trust issues

// April 8th, 2009 // No Comments » // .Net, Security, Troublesolving, Visual Studio

I use Subversion for all my code. I also like to keep my checked out code on a mapped network share since it has backup and is accessible from outside my main dev machine. With this setup you will sooner or later (probably sooner) run into the problem with Visual Studio not trusting the network share, and subsequently hitting you in the face and kicking you in the groin. To make our beloved studio behave more decent, I executed the following line of goodness into a Visual Studio Command Prompt:

caspol -machine -addgroup 1 -url file://h:/* FullTrust -name DevShare

This will put the mapped drive “h:” in the “Full Trust” group. Just replace the drive name (and perhaps choose another name than “DevShare”) with your specifics, and you should be good to go! Hopefully this will help someone. If not, you could check out the following post on StackOverflow.

EXT3 and reserved space for Super User

// March 31st, 2009 // No Comments » // Linux, Troublesolving, Ubuntu

Now that is what I call a stellar title for a blog post! If you instantly get that, you have probably been fiddling with Linux for a while.

Well then, let the me explain myself. This is mostly a note to self so I know what to do the next time I run into this. I just installed a new 1TB disk for my Linux (Ubuntu) server. I partitioned it, and executed a simple:

mke2fs /dev/sdd1

I then went ahead and mounted the new file system, and checked the available space. I was a bit disappointed to see that my 1TB drive only had 871GB available space! OK, this is quite a lot of space but I was not at all satisfied with that. After chatting away awhile with my buddy mr Google I realized that the EXT3 format reserves 5% of the partition for the super user. Supposedly this is to be used in case of emergency, but this drive was used to be used as a simple file storage backup drive. To remove/change the amount of the reserved space, you just issue the following commands. Please be advised that you should NEVER do this on a system partition!

First, unmount the partition if it is mounted

sudo umount /dev/hdb1

Then issued this command to decrease the reserved space to 0:

sudo tune2fs -r 0 /dev/hdb1

And then just mount the partition again

sudo mount /dev/hdb1

And that’s all there is to it. Afterwards I had 917GB of available space. That’s more like it.

SQL Server 2008 - Can’t save changes!

// March 9th, 2009 // No Comments » // .Net, SQL Server, Troublesolving

When using the SQL Server 2008 Management Studio I bumped into the following message while creating some new tables: “Saving changes are not permitted”.

Error Message

Error Message

Now, a warning that this is happening is just dandy, but totally preventing me from performing it was not what I expected. To get around the “problem” you need to disable an option. Simply select “Tools->Options”, then “Designers”, and finally uncheck the option “Prevent saving changes that require table re-creation”.

Options

Options

Ohh well, where was I now…

Neat tricks with CMD.EXE!

// August 12th, 2007 // No Comments » // .Net, Troublesolving

I recently needed to debug a service that run as the LocalSystem user. I was getting some strange errors and I suspected that user access rights was the culprit. I needed to be able to run some commands as the LocalSystem user through a shell (cmd.exe). I tried the most obvious solution, which to me was to use the “Run As…” command, but this didn’t work since the LocalSystem account can’t be used in this fashion. I found the solution in this blog post.

Be aware that the trick doesn’t work if you are connected to another computer through Remote Desktop! The CMD.EXE will be spawned at the local screen but not on your RDP connection.

Losing focus…

// December 1st, 2006 // No Comments » // General, Troublesolving

Well well, long time no blog. I thought it was about time I posted something here, and since I just solved a rather annoying problem I might even help someone else out there in the process.

Recently my computer has been acting very strange. I’m typing some code or chatting in MSN, and every 10 or so seconds the cursor loses focus from the current window. Now, the first time this happened I didn’t even noticed. I just reclicked on the window and continued to type. But something just kept stealing the cursor, and it quickly became very disturbing. As tried to remedy the problem, I remembered that I recently got a new phone and installed some software that came along with it. The phone is a SonyEricsson K610i, and while I like SE phones, I HATE their software. I poped up the trusty ol’ Task Manager and started to furiously kill processes. I struck gold when I hit “epmworker.exe”, and guess what, it belongs to the SonyEricsson phone software! What a surprise.

So, now I have control over my cursor again, even long enough to write this post. Oh happy day.