Posts Tagged ‘Windows’

Injecting VirtIO drivers into Windows 2012 R2 (wim and ISO)

Monday, June 2nd, 2014

Hello,

Recently I have begun toying around with Openstack and as soon as I got everything working the first thing I wanted to do was create a VM with Windows 2012 R2 on it, just to see if I could get it working.

I quickly realized that Microsoft had opted not to include the VirtIO drivers required for KVM into the Windows 2012 R2 install media.

After searching around and finding several different approaches to resolving this problem (most of which required me to purchase an ISO editor for Windows for some reason) I came up with my own solution that costs nothing and I am happy to share it with you.

Preparations:

  • Install the Microsoft ADK from here: http://www.microsoft.com/en-us/download/details.aspx?id=30652
  • Download the latest VirtIO drivers from here: http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/
  • Extract the VirtIO drivers to a temp folder (all commands will assume c:\tmp\virtio)
  • Extract Windows 2012 R2 ISO to c:\tmp\dist (we will assume that your ISO includes standardcore, datacentercore, standard, and datacenter editions)
  • Open the ‘Deployment and Imaging Tools environment’ as Administrator (this is very important).

#make some temporary folders to hold stuff

mkdir c:\tmp\iso
mkdir c:\tmp\mount

#update the boot images

imagex /mountrw c:\tmp\dist\sources\boot.wim 1 c:\tmp\mount
dism /image:c:\tmp\mount /add-driver /driver:c:\tmp\virtio\WIN8 /Recurse /ForceUnsigned
imagex /unmount /commit c:\tmp\mount

imagex /mountrw c:\tmp\dist\sources\boot.wim 2 c:\tmp\mount
dism /image:c:\tmp\mount /add-driver /driver:c:\tmp\virtio\WIN8 /Recurse /ForceUnsigned
imagex /unmount /commit c:\tmp\mount

#update the install images

imagex /mountrw c:\tmp\dist\sources\install.wim 1 c:\tmp\mount
dism /image:c:\tmp\mount /add-driver /driver:c:\tmp\virtio\WIN8 /Recurse /ForceUnsigned
imagex /unmount /commit c:\tmp\mount

imagex /mountrw c:\tmp\dist\sources\install.wim 2 c:\tmp\mount
dism /image:c:\tmp\mount /add-driver /driver:c:\tmp\virtio\WIN8 /Recurse /ForceUnsigned
imagex /unmount /commit c:\tmp\mount

imagex /mountrw c:\tmp\dist\sources\install.wim 3 c:\tmp\mount
dism /image:c:\tmp\mount /add-driver /driver:c:\tmp\virtio\WIN8 /Recurse /ForceUnsigned
imagex /unmount /commit c:\tmp\mount

imagex /mountrw c:\tmp\dist\sources\install.wim 4 c:\tmp\mount
dism /image:c:\tmp\mount /add-driver /driver:c:\tmp\virtio\WIN8 /Recurse /ForceUnsigned
imagex /unmount /commit c:\tmp\mount

#create the new ISO using Microsoft’s own tool which they likely use to master their own ISOs…

oscdimg -m -o -u2 -udfver102 -bootdata:2#p0,e,b”c:\tmp\dist\boot\etfsboot.com”#pEF,e,b”c:\tmp\dist\efi\microsoft\boot\efisys.bin” C:\tmp\dist C:\tmp\iso\windows2012r2virtio.iso

Upgrade to Vista Ultimate and fight AIDS

Monday, December 8th, 2008

The holidays are a great time to give back to the people you love, your friends, and those whom are less fortunate than ourselves.

The Project (RED) version of Windows Vista Ultimate which has been shipping on Project (RED) versions of some systems will soon be available for purchase separately.

It is available for pre-order currently from Amazon

Project (RED) is an organization which is fights AIDS.

Pre-Order Windows Vista Ultimate with SP1 Upgrade (Project Red Edition)

Five Minute Guide: BartPE CD

Tuesday, February 19th, 2008

In this 5 minute guide we show you how to create a BartPE CD.

BartPE is a live CD for Windows environments similar to Knoppix for Linux. It allows you to recover from all sorts of nasty situations such as disk mis-configuration, driver tragedy. I must admit that until recently I hadn’t used BartPE because I’ve never had an issue that needed a LiveCD for a Windows machine.

I decided I would whip up this 5 minute guide to creating a BartPE CD to go along with an article on fixing an issue with 64 Bit Windows 2003 Virtual Machines in VMWare.

You will need:

–A retail Windows CD either XP or Windows 2003 (Note: BartPE does not appear to work with R2, X64, or any Enterprise/Datacenter edition of Windows 2003, it does not find the files on the CD) I used an original Windows 2003 Web Edition CD I had laying around.
–A CD Burner (If you want to create an actual CD)
–A Blank CD (See above)
–The latest version of BartPE
–5 minutes

–Insert your Windows 2003 or Windows XP CD-ROM into your CD-ROM drive.
–Download BartPE from the link above or from the author’s web-site at http://www.nu2.nu/pebuilder/#download
–Install the application and launch ‘PE Builder’
–You should be presented with the screen listed below

bartpescrn 
–For source select the CD-ROM drive where you inserted the CD or any other folder which contains the contents of a Windows CD.
–**optional and probably not needed** For custom specify a folder which you want to include in your Pre-installed Environment. (this could include tools, etc…)
–For output I created a new temporary folder for so I would remember to delete the files later. Decide where you want BartPE’s output to go, and then select that path here.
–Plugins
If you have a specific need in mind, i.e. virus scanning or adware removal, you may want to checkout the ‘Plugins‘ button at the bottom of the screen, there appear to be many useful utilities available in that collection.       

Media Output
Here is where you have to make a choice.

-None means that it will not create an ISO or a CD and that it will simply output its files to the “output folder”.
-Create ISO Image means that it will create a ISO image bootable ISO image of the output which you can either choose to burn later using your favorite CD authoring software OR boot a virtual machine with.
-Burn to CD/DVD means that PE Builder will go ahead and create a bootable CD-ROM with the output on the disc.

There is no right or wrong answer, but ask yourself what are your needs? Are you going to be using this to fix a virtual machine? If so, than you most likely will not need physical media (CD-ROM) and you can just use the .ISO file. Besides, even if you have PE Builder create the .ISO file and you find out later that you need a CD, you can always burn the CD later using Nero or whichever authoring tool is your favorite. My suggestion would be to create the .ISO file and keep it around incase you lose the CD or need to boot a virtual machine which is being stubborn about booting from the physical CD-ROM drive.

Once you’ve solved that moral dilemma, simply click ‘Build’ and your requested action, whether it is None, Create ISO Image, or Burn to CD/DVD should be completed in a jiffy.

Note: It took me a lot longer than 5 minutes to make my BartPE disc, mainly because it took me about 4 hours to find a Windows 2003 CD it would ‘accept’. Where’s the love for the R2 X64 Data Center SP-2 nLite custom CDs Bart? :-) (Just kidding) Although it would be nice if it accepted other types and slightly newer media such as Volume Licensing, R2, X64, etc.

Enjoy!
-Drew

How do I delete directories hackers create on my system?

Tuesday, February 14th, 2006

Occasionally we all make mistakes, we leave anonymous FTP enabled and some 12 year old kid uploads his Britney Spears MP3 collection to your web server. In another instance you find yourself with a 200GB hard drive that you’ve only used 30GB of, but it reports there is only 20GB remaining, and you find out that your RECYCLER folder has been the generous host to a bunch of German pornography for however many unknown months.

Many times simply finding the locations of these files can be a daunting task; we have written an in-depth article that exposes some of the common methods that your average 13 year old N-SYNC fan uses to put his Madonna MP3 collection onto your corporate fileserver in another article. Once you find the files, if you cannot delete them; that is probably one of the most frustrating moments as a system administrator.

To do this, we employ methods from 15 years ago (thanks Microsoft).

If you do already know how to do this, open a command prompt by doing the following:

click start navigate to run type cmd.exe and press enter

Navigate to the parent folder of the questionable content (i.e) the folder named ” . . . . I Jh0000n yoUhz!”

cd e:\inetpub\wwwroot\site

First we take a quick look at the directory to see what we see:

E:\inetpub\wwwroot\site>dir
Volume in drive E is IIS
Volume Serial Number is 1034-05BD

Directory of E:\inetpub\wwwroot\site

03/02/2006 03:26 PM  .
03/02/2006 03:26 PM  ..
12/30/2003 11:22 AM
12/20/2003 11:11 AM  Admin

Do you notice that there is a directory with no label? FTP hijackers and other script kiddies often use this technique to try to mask their activities in order to throw off system administrators and make it harder to delete their “distro sites”. It is in fact very simple to delete these sites:

E:\inetpub\wwwroot\site>dir /x
Volume in drive E is IIS
Volume Serial Number is 1034-05BD

Directory of E:\inetpub\wwwroot\site

03/02/2006 03:26 PM  .
03/02/2006 03:26 PM  ..
12/30/2003 11:22 AM  0200~1
12/20/2003 11:11 AM  Admin

Notice how the directory with no label is actually called 0200~1? That is the true name of the folder on the server. First we will empty the contents of this directory:

del 0200~1

Now we will remove the directory entirely.

rmdir 0200~1

The massive store of Justin Timberlake MP3s is now gone, and young Timmy from Brazil has to fire up Bearshare and start all over again. (Boo, Hoo, Hoo.) The real question is: Do you know how those files got there? If you cannot honestly answer this question, you should read our article “Where’d my Disk Space Go?”

-Drew