How to perform a P2V conversion for FreeBSD to run on Hyper-V

One of my big projects with my personal server setup, was to turn my current physical FreeBSD server into a Hyper-V VM. Why would I do this? Don’t ask, because I don’t want to start a religous war here… let’s just say that as much as I like FreeBSD for a lot of purposes, I do not like living with it as a sys admin without a paycheck attached.

So, here’s how I went from FreeBSD on a physical machine (garbage x64 hardware) to a Hyper-V VM (Windows 2008 R2 on garbage x64 hardware).

  1. Upgrade the FreeBSD machine to version 8.0-RELEASE. This is mandatory.
  2. Get Hyper-V installed and configured, including enabling Intel VT in the BIOS.
  3. Shut down both machines. Transfer the physical hard drive from the FreeBSD machine to the Windows 2008 R2 machine. Turn on the 2008 R2 machine, and verify in Disk Management that the transferred drive is visible.
  4. Create a new Hyper-V VM for the machine, but do not specify a hard disk. Go back into the settings, and remove the NIC that was put into the VM. Do “Add new hardware” and select “Legacy Network Adapter”, and connect the new NIC to the network of choice.
  5. Create a new virtual disk. Select “Fixed” type, and on the next page in the wizard, tell it to copy the contents of a physical disk. Choose the disk you transferred from the FreeBSD machine.
  6. Go eat dinner, walk the dog, read a magazine. You’ll be here a while during the disk copy. To be on the safe side, go download the “Live FS” FreeBSD ISO appropriate for your installed FreeBSD version.
  7. Once the new virtual disk has been created, go back into the VM settings, move the optical drive to postion 1 on the IDE chain, and then add the newly created disk to the VM on position 0 on the IDE chain.
  8. Start the VM. If you receive errors like “Invalid slice”, you need to do the following:
    1. Insert the Live FS ISO into the virtual DVD drive and reboot the VM.
    2. Go to “Configure” and then “Fdisk”. Set the main drive slice (the big one) to be bootable, and then press “W” to write the information to disk. Before it writes, it will ask about a boot loader; choose the standard one, unless you have a good reason not to and know what you are doing.
    3. Exit the Live FS system, eject the ISO, and reboot the VM.

    This should take care of the “bad” boot loader.

  9. If the physical disk in the original server was not device “ad0” (for example, it was a SCSI drive or a RAID 1 member), then the system will spaz when you boot and drop to single user mode. Not to worry! In single user mode, do the following: (note: if you can’t even get into single user mode, boot off of the Live FS CD and use the “Fixit” shell)
    1. Re-mount the root partition as writeable with:mount -u /
      mount -a
      Likewise, mount /usr and /tmp with:
      mount /dev/ad0s1f /usr
      mount /dev/ad0s1e /tmp
    2. Now you can actually use your text editor of choice to edit /etc/fstab and set the references to the old drive to be references to the new drive as ad0. Do that and reboot.
  10. You are in the home stretch now! You should be booted into FreeBSD, albeit a crippled one, because the NIC isn’t configured. Go edit /etc/rc.conf and change the reference to your old NIC to be a reference to de0 (the NIC that Hyper-V provides). Reboot again, and you should be done!

This is what I did… it might not work 100% for you, for better or for worse.


Introducing “CNB ImageGuide”

Should you save your image as PNG or JPG? ImageGuide is a program which helps you choose the best format..

Web images are usually saved in either .JPG or .PNG format, but unfortunately most people have no idea which is best for their picture.

The top image should be saved as JPG. The bottom should be saved as PNG.
Top: Photos should be saved as JPG. Bottom: Simple images should be saved as PNG. Both: Notice the lost detail and corruption when the wrong format is used.

The very simplest rule of thumb is:

  • If it’s a photograph, use .JPG
  • Otherwise use .PNG

Graphs, charts, and screenshots are often (incorrectly) saved as .JPG even though as PNG they would look better and be smaller. An extreme example is this image of every color. Saved as .PNG, it’s only 58KB. As .JPG, it is 1.1MB — 19 times larger and even at that size it looks blocky compared to the PNG version.

Unfortunately, even many surprisingly knowledgeable website authors seem to lack this knowledge.

In order to help people make the most of their pictures and their time, I’ve written ImageGuide — a program which aims to make it absolutely as easy as possible to pick the best image format, or even choose for you. You can download it here

Continue reading Introducing “CNB ImageGuide”

Some Black Friday picks

Happy Thanksgiving everyone!  This post is going to change as things get updated.

Extreme slowness on SSD systems?

A friend of mine has a laptop with an SSD. Recently the system was crawling at a fraction of its former speed, with no logical explanation. After a lot of time with tech support, he discovered that the DMA controller on the drive was shot, which forced everything to go through the CPU. To check this out for yourself, look at the IDE channel’s properties in Device Manager. If the IDE channel is set to “Auto Detect” but is running in PIO mode, that’s the problem and the drive will need to be replace. The screenshot if from Windows XP.

SSD Problem Screenshot


Getting A2DP stereo BlueTooth should be easier in Windows

Updated 11/22/2009

Anyone who has ever tried to get wireless BlueTooth A2DP working in the last three versions of Windows will come to the following conclusion.  Getting A2DP stereo BlueTooth needs to be WAY easier in Windows XP, Vista, or Windows 7.  Getting basic BlueTooth connectivity working for wireless mice or keyboards is fairly painless and easy because everything just works out of the box after you plug in a BlueTooth adapter into your computer, and you’re tricked into believing that everything is already working and installed.  Trying to get low quality monophonic headset audio working is hard enough and trying to get A2DP high quality stereo working is a royal pain.  This is something that’s amazingly simple on any modern cellular phone but it almost seems like rocket science in Windows.

The first thing you’ll notice in any recent version of Windows when attempting to connect a BlueTooth headset is that it will ask you for a bunch of drivers.  Scanning the Internet or local hard drive won’t yield any results, and you’re left scratching your head wondering what happened and why the headset doesn’t come with any drivers.  But as it turns out, you need additional drivers for your BlueTooth adapter to make any of this stuff work.

On my Lenovo X200, I downloaded the latest BlueTooth drivers compatible with Vista or Windows 7 here only to find out that only low quality 8-bit monophonic audio is supported.  I had to search the Internet to figure out that I needed the WIDCOMM BlueTooth drivers from Broadcom, and Broadcom BlueTooth chipsets are very common though there are others on the market and you’ll need to get drivers from the chipset manufacturer.  The driver install was fairly automated, but it took a LONG time to install and it required a reboot.  I also had to connect and disconnect the A2DP headset and reconnect to get it working, but it worked beautifully when it did and sound quality was amazing.

Now my problem is that I need to find functional A2DP drivers for these super mini USB 2.0 BlueTooth dongles I got from for $2.36.  Bluesoleil for Windows version 6 worked fine with this cheap adapter, but Bluesoleil costs $30!  There’s just no way I’m paying $30 for a set of drivers to run a $2 dongle.  You’re much better with a jWIN JB-TH101 which comes with A2DP drivers and it’s smaller.  It’s only $10 if you can pick it up at a Fry’s store and avoid shipping charges.  Getting it online might double the price due to shipping.  I have a nice little IOGear GBU421 which comes with drivers but I used the Broadcom WIDCOMM drivers but it might cost you $20 with shipping.

sku_8422_1And here’s a parting tip.  I bought this amazing BlueTooth to 3.5 mm stereo jack adapter (includes a microphone as well) for $13.  The cheap plastic earphones are lousy but you don’t have to use them and it’s worth it even without any earphones.  More importantly, having the ability to connect your own high quality earphones is even more important.

The real purpose behind Net Neutrality is anything but honorable

Many of use suspected that there were ulterior motives behind Net Neutrality regulations, but we never thought it would be this blatantly underhanded.  I had a chance to speak with one of the biggest experts on Internet peering William Norton and it was an eyeopener for me.  The resulting article below has some very interesting revelations.

FCC NPRM ban on Paid Peering harms new innovators

The current FCC NPRM would prohibit paid peering agreements and harm small content providers while ensuring Google’s dominance on content distribution. Google is big enough to get free peering, but the NPRM would force their competitors to pay more for inferior transit access.

Debunking the hype that the new BitTorrent protocol is “network friendly”

uTP-network-friendlyThe story that the new BitTorrent client uTorrent 2.0 is “network friendly” is making the top headlines on the Web and mailing lists.  The only problem with this story it that it has no actual data to back up its assertions.  I took the time yesterday to run some tests on the new uTorrent 2.0 beta build 16850 which supports the new “friendly” BitTorrent UTP.  Based on my initial testing, the claim that the new BitTorrent client is network friendly appears to be false.

Read the rest at Digital Society.