Welcome to B# .NET Technical Community Homepage Sign
in | Join
| Help

B# .NET
Blog

Bart De Smet's on-line blog (0x2B | ~0x2B, that's the
question)

RSS 2.0

Atom
1.0

Home

About

Email

<

september 2006

>

ma

di

wo

do

vr

za

zo

28

29

30

31

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

1

2

3

4

5

6

7

8

Search
Go

Archives

oktober
2006 (6)

september
2006 (49)

augustus
2006 (20)

juli
2006 (11)

juni
2006 (7)

mei
2006 (10)

april
2006 (21)

maart
2006 (24)

februari
2006 (1)

januari
2006 (10)

december
2005 (3)

november
2005 (6)

oktober
2005 (22)

september
2005 (16)

augustus
2005 (25)

juli
2005 (49)

juni
2005 (17)

mei
2005 (3)

maart
2005 (17)

februari
2005 (13)

januari
2005 (9)

december
2004 (25)

november
2004 (9)

oktober
2004 (10)

september
2004 (12)

augustus
2004 (11)

juli
2004 (4)

juni
2004 (17)

mei
2004 (17)

april
2004 (7)

maart
2004 (11)

februari
2004 (8)

januari
2004 (13)

december
2003 (4)

november
2003 (10)

oktober
2003 (14)

News

MVP Visual C#

Developer & IT Pro Days
2006

Microsoft Tech Ed 2006: Developers

Post Categories

.NET
Framework 3.0 (WinFX) (11)

.NET
Framework v2.0 (50)

ASP.NET
(44)

ASP.NET
v2.0 (7)

Avalon,
Indigo, WinFX, XAML (9)

C#
2.0 (48)

C#
3.0 (10)

CLR
Hosting (7)

Coding
Webcasts (7)

College
(2)

Comega
(10)

IT
Forum 2005 (3)

IT
Forum 2006 (4)

IW
stuff - Office, SharePoint, IBF (2)

Microsoft
(140)

MMC
3.0 (1)

MSN
(5)

Office
development (4)

PDC
2005 (8)

Personal
(127)

Security
(35)

Spec#
(2)

SQL
Server 2005 (14)

SSCLI
(4)

TechEd
2005 Europe (14)

TechEd
2006 Europe (5)

Virtual
Server 2005 (1)

Visual
Studio 2005 (24)

Windows
Communication Foundation (WCF) (4)

Windows
Live (2)

Windows
Live Messenger (1)

Windows
PowerShell (18)

Windows
Vista (39)

Windows
Workflow Foundation (WF) (5)

Microsoft

Microsoft

MSDN Worldwide

ASP.NET

GotDotNet

MSDN Belux

Longhorn SDK

MSDN Lab

Personal

Bart De Smet homepage

Other bloggers

Belgian
bloggers

Arlindo Alves

Gunther Beersaerts

Christof Claessens

Gerd De Bruycker

Ritchie Houtmeyers

Yves Kerwyn

Rudi Larno

Alain Leroy

Tom Mertens

Jan Tielens

Patrick Tisseghem

Jurgen Van Duvel (Dutch)

Hans Verbeeck

Hans Verbeeck (MSN)

Bruno Segers (Dutch)

Steven Wilssens

Jelle Druyts

Guys from Redmond

Brad Abrams

Chris Anderson

Don Box

David Broman

Dan Fernandez

Euan Garden

Eric Gunnerson

Scott Guthrie

Michael Howard

Jesper Johansson

Jonathan Keljo

Rico Mariani

Lukasz Pawlowski

Steve Riley

Jason Zander

Maoni

Joe Duffy

zaterdag 2 september 2006 18:55 bart

Offline VHD file mounting on the host operating system with Virtual Server
2005 R2 SP1 Beta 2

Introduction

A couple of days ago Virtual Server 2005 R2
SP1 Beta 2 was released to Microsoft
Connect. The SP1 release of Virtual Server
2005 has a lot of exciting features, a little list:

AMD Virtualization Technology (AVT)
compatibility

Volume Shadow Service support

Offline VHD mounting

Active Directory integration and management
features

Hardware-assisted virtualization with Intel
Virtualization Technology

Whitepaper on Virtual Server host
clustering

Larger default size of 127 GB for dynamically
expanding virtual hard disks

Virtual SCSI fix for Linux guests

Without doubt worth to check it out (and not to
forget: it's free). In this post however I'll be looking at one feature: the
Offline VHD mounting which allows you to take a VHD file and
mount it as a drive in Windows without having to launch Virtual Server or
Virtual PC. This allows you to manage (service) the disk offline. But there's
more: because Vista's CompletePC
Backup creates VHD disks, it can also be used to service an image
of a Vista pc offline.

Installing Virtual Server 2005
R2 SP1 Beta 2

Below you'll find the instructions to do offline VHD
mounting on Windows Vista build 5472. The steps should be applicable to future
releases too. For Windows XP and Windows Server 2003 users, the steps are the
same except for the layout of some messages (such as the driver installation
dialog) and the lack of UAC prompts.

The first step is to set up Virtual Server 2005 R2
SP1 Beta 2 which you can download via http://connect.microsoft.com/ if
you're participating in the beta program (check the site for "Available
connections"). Choose a Custom installation and make sure the
VHD Mount feature is checked:

The remainder of the setup should be well-known and
straightforward. Make sure you have installed IIS prior to the installation of
Virtual Server 2005 because the setup will install the administration website.
During the setup you'll see two driver installation messages.
Choose to install the driver whenever the systems asks:

When setup has completed, you'll get to see the
familiar Installation Summary page. As explained in my
previous post you'll need to "run as administrator" IE to get the
Administration Website up and running.

Offline VHD mounting
step-by-step

On to the VHD mounting stuff. Open a command prompt
and navigate to %programfiles%\Microsoft Virtual
Server\Vhdmount. Now execute vhdmount.exe as shown
below, specifying the vhd file and the driver letter to be used to mount the
file:

On Windows Vista, this will fail however due to
security restrictions for unsigned drivers:

To solve this issue, go to the Computer Management
MMC (right click Computer in the Start menu and choose Manage). In the
Device Manager, you should see a Disk drive device called
"Microsoft Virtual Server Storage Device01":

Right click this device, go to Properties, tab
Driver and choose Update Driver:

Now choose 'Browse the computer for driver
software':

Now point to the Vhdmount folder that contains the
driver software:

The system will ask to confirm the installation again
(choose Install) and finally the driver installation will succeed:

Now the window with the vhdmount.exe executiong
should indicate a successful mount. In my case, the VHD had more than one
partition so the vhdmount.exe tool complains it wasn't able to mount every
volume on the virtual hard disk.

In the Device Manager you'll see two devices being
added to the system, a "SCSI disk device" and the corresponding "storage
device":

Through Disk Management you can now see the disk. In
case the mount failed (on XP it will because drive-letter mounting isn't
supported through vhdmount.exe on that platform), you can assign drive letters
over here (see Windows Help for more information):

Of course in Windows Explorer you'll see the drive
too:

So, that's it. You can now access the drive and make
the desired changes (or grab the files you need). Notice that (unless your host
computer is in the same domain as the computer that's living on the VHD file)
the ACLs will display unknown SIDs. Only built-in accounts and groups will be
recognized (these have a fixed SID):

To dismount and unplug the VHD disk
run vhdmount.exe /u All (or specify the VHD file name you want to
unplug):

An overview of the vhdmount.exe command:

Command line utility to mount a Virtual Hard
Drive (VHD) file as a virtual disk device.

Usage:
VHDMOUNT /p VHDFileName
VHDMOUNT
/m VHDFileName [DriveLetter]
VHDMOUNT /u VHDFileName | All
VHDMOUNT /q
VHDFileName | All

/p           Plugs in
the specified VHD file as a virtual disk device
without

mounting the
volume.
/m           Plugs
in the specified VHD file as a virtual disk device
and

mounts the
volume.
/u
Unplugs the virtual disk device for the specified
VHDFileName.
/q
Returns the disk name of the mounted virtual disk device
for

the specified VHDFileName.

VHDFileName  VHD file name including
full path.
DriveLetter  Optional parameter for /m option. If drive
letter is
specified

the volumes are mounted starting at the spefied drive
letter.

If drive letter is not specified it is automatically
assigned.
All          Applies
the operation on all mounted virtual disk
devices.

This parameter is applicable for /u and /q.

Happy mounting!

Filed Under: Virtual Server 2005

Comment Notification

If you would like to receive an email when updates are made to this post,
please register here

Subscribe to this post's comments using RSS

Comments

No Comments

What do you think?

Name
(required)*

Your URL
(optional)

Comments
(required)*

Remember Me?