How to make a virtual disk in Windows 8. Creating virtual hard disks in Windows

  1. How to install on virtual disk Windows 8? Hello admin! At first I wanted to, but then I changed my mind, there were too many body movements. First of all, you need to download and install a virtual machine, then configure it correctly and only then install Windows 8 into it. What if you install Windows 8 on a virtual disk, because this can be done almost immediately. Are there any difficulties in installing and then removing eight from the boot menu? Vlad84.
  2. Hello admin, I created a virtual disk in Windows 7 and installed Windows 8 on it and now only it boots, how can I restore the selection when starting the computer? operating systems, because I also need Windows 7.

How to install Windows 8 on a virtual disk

Hello, friends! The advantages of installing Windows 8 on a virtual disk are well known.
First of all, our reader is right, everything happens a little faster than in the case of a virtual machine and there is no need to install various updates and additions to the virtual machine.
Secondly, if you need to create temporary folders in a virtual machine, and USB filters to work with flash drives, then in Windows 8 installed on a virtual disk, all files hard drive will be available as is.
Well, the most compelling argument is that when installed on a virtual disk, Windows 8 will work faster than in a virtual machine.

Let's install Windows 8 on a virtual disk together and see everything with our own eyes.

  • Note: Read our new articles on this topic "", I confess, this method is much simpler than the one described here.

Install Windows 8 on a virtual disk you can from Windows 7 or from Windows 8. If you don’t know where you can do it, follow the link and read our article.

For example, I have Windows 7 installed on my computer and I want to install a second one Windows system 8 per virtual HDD.
First you need to create a virtual disk in VHD format. Right-click on “Computer” and select “Manage”

"Disk Management".

"Action" and "Create virtual hard disk"

Click “Browse”.

In the explorer that appears, select the hard disk partition where we will create the virtual disk. My hard drive is divided into two partitions: C: and E:, I select the E: partition, give the name of the virtual file Windows disk 8 and click “Save”.

It is better to select “Dynamic expansion” for the virtual hard disk format and the size of the hard disk will expand as files accumulate in the virtual disk. I will choose the size 30 GB. OK.

Insert into the drive installation disk with Windows 8 and boot from it, if you don’t know how to do this, read "". I think you did it. Further.

Install.

We accept the license agreement. Custom: only Windows installation.

To open the command line, press Shift + F10.
IN command line dialing
Diskpart
I created a virtual disk on the E: partition, so the next command will be like this.
select vdisk file= E:\Windows8.vhd
attach vdisk
exit
exit

Update

The usual installation of Windows 8 takes place. Assign a Name to the computer and Next.

Use standard settings.

If you don't want to configure account Microsoft, disconnect the internet.

Create a local account.

Enter your Name, Password and Password Hint. That's all.

Note: More details about

Both of the above operating systems have built-in tools for creating a virtual drive, which can be used to solve a wide range of tasks, from installing the OS to creating a secure container for storing critical documents.

A virtual hard disk looks like a file with a VHD extension, which, like an ISO image, can be mounted on the system or transferred to another computer. On the other hand, when initialized, such a file appears in Explorer as a regular disk and you can also copy and move files to it without using third-party programs.

Among the abundance of possible operations, the most popular are still installing Windows on a similar drive and then launching it on a PC and using encryption programs to create virtual protected containers.

How to create a virtual hard disk

The procedures for creating and using a VHD disk in the Windows 7 and 8 operating systems are almost identical, with the small exception that in the latter case a similar file can be mounted double click mice.

So, the first step of this procedure is to open the Disk Management window. To do this, select the appropriate menu in the Panel Windows tools 8 (Win + X keyboard shortcut) or enter the command “diskmgmt.msc” in the Run dialog box (Win + R keys).

Next, you need to select the “Action” item and the “Create virtual hard disk” sub-item. Please note that here you can also find the line “Attach a virtual hard disk”, which is useful for users of version 7 of Windows when transferring a file container from one PC to another.

In the wizard that opens, the user is prompted to select the location of the disk file, its size and one of the available formats (dynamic/fixed).

After clicking the “OK” button, a “blank” virtual drive will appear in the “Disk Management” window, which needs to be initialized. To do this, after right-clicking the mouse, you need to select the appropriate context menu item and then decide on the partition style (MBR is suitable for most tasks).

The next step is to select the line “Create a simple volume” from the right-click drop-down menu, where you set the volume formatting parameters, its size and name.

As a result of this simple operation, a new disk, which you can work with just like a regular HDD. However, do not forget about the location of the source file, because all data is essentially stored there.

Hello dear readers of the blog www.site. In the context of the release of a new operating system Windows 8.1 from Microsoft, it's time to remember the possibility of its installations on virtual disk VHD.

This is especially true for the trial version - Windows 8.1 Preview, since probably not many people will want to immediately install it as their main system. Officially test Windows 8.1 Preview will be available until January 15, 2014. Yes, even after release working version system, it makes sense to try it first.

Installing Windows 8.1 Preview slightly different from other versions. The difference is that to complete its installation you must use accounting Microsoft entry . Possibility of installing the system with using local account will be back in the final version Windows 8 .1 . For now, you can create a local account only after completing installation with a Microsoft account.

The process itself installing Windows 8.1 Preview on a VHD drive in general no different from Windows 7 / Windows 8 and Windows Server. In this case, you can choose various ways installations, as well as their combinations. In this sense, the description of methods presented in the article installing Windows 8.1 Preview on a virtual disk can be safely extended to the above versions of Windows.

First you need to prepare the following:

  • Download the required Windows 8.1 Preview ISO distribution from the Microsoft website and save the installation key (the download link is at the beginning of the previous one);
  • Register an account with Microsoft (if you don't already have one);

Depending on the method that will be chosen for installation:

  • When traditional way installation from removable media, burn an ISO image of the distribution kit to a DVD or USB flash drive (the simplest preparation method bootable usb flash drives has been described);
  • If you plan to deploy the system on a virtual disk using the utility ImageX, then you need to take care to obtain its current version.

You can download the updated and corrected version of ImageX from the Microsoft update page KB2525084. Updates will be sent upon request. On the page you need to open “Show fixes for all platforms and languages”, select the platform and specify email address to receive a link to download the file.

I must say that when testing this installation option for Windows 8.1 Preview, I initially used an outdated version of ImageX and the system did not start. Perhaps it was just a coincidence and this was not the reason, but it is better to use the updated utility.

If there is only one computer, then write down the installation key and some of the commands described below that will definitely be needed during the installation process on a piece of paper in advance.

Installing Windows 8.1 on a virtual disk from bootable media

First, let’s complicate the task a little and do a “clean” installation of Windows 8.1 Preview on VHD. That is, suppose that initially we have a computer with a clean HDD disk, therefore, there is no operating system.

Installing Windows 8.1 in VHD on a blank disk

The practical meaning of this installation option is not very obvious; most likely, the installation will actually be carried out in parallel with the existing Windows 7 / 8. But it is very indicative from the point of view of the process itself and is therefore valuable.

We will do it virtually VirtualBox machine. I didn't make a mistake. If anyone doesn’t know yet, virtual disks can be nested one inside the other.

For clarity, we will create the main disk of the virtual machine corresponding to the hard disk real computer, in VDI (VirtualBox Disk Image) format, and the one embedded in it, on which the operating system will be installed, in VHD (Virtual Hard Disk) format.

From this moment on, you can safely forget that all the examples shown below were made in the VirtualBox virtual machine - they are no different from a real computer, except for the size of the disks (for testing, I created in the corresponding virtual Windows machine 8.1 dynamic disk VDI 25 GB).

We boot the computer from a USB flash drive or DVD with the system distribution kit (in a virtual machine from a virtual optical drive). On the very first screen, change the “Input method (keyboard layout)” from “Russian” to “USA”. “Next” -> “Install”.

Enter the product key, accept the license terms, and on the installation type selection screen, check “Custom: Windows installation only...”.

Click “Create”. Select the partition size on which the virtual disk with Windows 8.1 will be placed. “Apply.” We agree with the installer’s warning that to ensure correct Windows operation may create additional partitions...” We are talking here about the first partition “System Reserved” with a size of 350 MB.

In Windows 7, the size of this partition was 100 MB. As we have already discussed, an increase in the volume of the partition was done in Windows 8 to transfer the “Recovery” folder to it.

If not the entire disk is allocated for the system, then its unallocated area will still be present in the list.

As everyone has already noticed, up to this point the installation did not have any special features. Now we need create and attach a virtual disk.

Select the main created partition (in the example – Partition 2) and click “Format”.

After formatting is complete, launch the command line using the key combination “ Shift + F10" If the Russian keyboard layout was left at the first installation step, switch it to English using “ Alt+Shift" We dial:
diskpart
list vol

Find the volume number on which the virtual disk will be located. In our case – “2”. Let's continue:
select vol 2
create vdisk file=D:\Windows81p.vhd maximum=21760 type=expandable The disk name (letter) in your case may be different, the name of the vhd disk is arbitrary, the size of 21.7 GB in the example was chosen to leave 15% free space on the main volume.

After creating a new virtual disk, connect it to the system:
attach vdisk
After the message about the successful connection of the disk, type twice:
exit
and return to the disk selection screen:

Click “Update”. “Unallocated space on disk 1” appears in the list. This is the newly created and connected virtual disk. We switch the focus to it, ignore the warning that Windows cannot be installed on it and click “Next”. The Windows installation process begins, which is no different from installation on a regular hard drive.

After its completion, you can make sure that with this installation method the placement structure system files and directories is no different from a system installed directly on the hard drive. The only difference is that the quality boot partition is used virtual disk.

To verify this, go to the Windows 8.1 system installed on the virtual disk and click “ Win+x" In the list that appears, select “Disk Management”. Select the “Reserved by the system” section and assign any free letter to it, for example “S”.

This is not enough to see the contents of the first system partition. Press “Win ​​+ x” again and go to “Control Panel” -> “Folder Options”:

On the “View” tab, enable the visibility of hidden and protected system files.

Now you can make sure that the download control ( bootmgr) remains on the system partition of the hard drive, and Windows boot loader (winload) is located on a virtual disk. We will return to download management a little later.

Interestingly, the “Recovery” folder suddenly appeared on the C:\ drive again. What is it for?

Installing Windows 8.1 on a virtual disk from bootable media in addition to the existing system

In fact, we have already described this installation option above. There is practically nothing to add to it, but new opportunities appear. For example, a virtual disk can be created in advance on the main Windows 7/Windows 8 system.

To do this, open “Computer Management” -> “Disk Management” -> “Create a virtual hard disk”:

A similar result can be achieved on the command line using the utility diskpart. To do this, you need to launch the command line as an administrator and run the commands already given above.

The virtual disk created in the GUI or on the command line can only be connected using diskpart at the very beginning of installation from removable media.

The main thing is to remember, or first write down, the path and the name that was assigned to it when created in the main system.

It is advisable to connect the virtual disk immediately after entering the product key. Click “ Shift + F10” and repeat all the commands described above with the exception of:
create vdisk file=
Next, almost everything is the same as in the version with installation on a blank disk. Create and format none sections, naturally, no need.

The method of installing Windows on a VHD from bootable media seems to be the simplest and most natural. In this case, however, you will need to make a bootable USB flash drive or burn a DVD.

Create a bootable Windows virtual disk using Disk Utilities from a .wim image file

In addition to directly installing Windows on a virtual disk, which we learned about in the first part of the article, you can burn the system to a VHD using disk utilities Disk Management Tools.

It is assumed that by this moment there is the necessary distribution kit with Windows 8.1 and using any of the methods described above, a new virtual disk with a size sufficient for the installation and operation of the system has been created.

Since the operation of copying files to a virtual disk is ahead, it must be formatted.

This can be done in “Computer Management” -> “Disk Management”. You need to “Attach a virtual hard disk” and then format it to file system NTFS.

On a command line running as administrator, this can be done using diskpart.
diskpart
select vdisk file=D:\Windows81p.vhd
attach vdisk
create partition primary assign letter=V
format quick FS=NTFS label=VHD
exit
Accordingly, the drive letter and the name of the assigned label may be different.

You can offer various options for solving the problem. Let's start with the utility ImageX.

Preparing a bootable virtual disk using the ImageX utility

How to get current version ImageX was described above.

First, you need to extract the file from the ISO image of the operating system distribution and place it on any existing computer disk Install.wim. Its size is about 3 GB. This can be done, for example, using free archivers 7-Zip or Hamster.

If there bootable flash drive or DVD with the system, then you can use Install.wim directly from removable media.

Write boot command Windows files from the Install.wim image to the virtual disk looks like this:
imagex/apply<путь до файла.wim> <индекс образа> <путь до файл.VHD>
Information about the images recorded in .wim and their indexes can be found with the command:
imagex/info<путь до файл.wim>| more
The Windows 8.1 trial .wim file contains two images:

  1. Windows 8.1 Professional Preview;
  2. Windows 8.1 Preview.

Let's use, for example, the image with index “1”.

Finally, assuming that the Install.wim file is located in the root of the F:\ drive, for our example the command would look like this:
imagex /apply F:\Install.wim 1 D:\Windows81p.vhd
If the created virtual disk is connected to the system, for example, to the letter V:\, then you can do this:
imagex /apply F:\Install.wim 1 V:\
Next, all that remains is to wait for the operation of deploying the image to the virtual disk to complete and disable it in “Disk Management” or with the following commands:
diskpart
select vdisk file=D:\Windows81p.vhd
detach vdisk
exit

Preparing a bootable virtual disk using the Install-WindowsImage.ps1 script

An alternative to the one just discussed is to use PowerShell script Install-WindowsImage.ps1. In fact, the meaning of the process does not change at all, it’s just that instead of ImageX, one might say, another utility is used.

Download Install-WindowsImage.ps1 available on MSDN. After saving the script on your computer, you need to go to its properties and unlock it:

You may also need to change the policy to run the script. PowerShell execution. To do this, launch PowerShell with elevated privileges (“Start” -> “All Programs” -> “Accessories” -> “ Windows PowerShell" In the “Windows PowerShell” context menu, click right click mouse “Run as administrator”).

In the window that opens, write the command:
Set-ExecutionPolicy RemoteSigned
We confirm our desire to change the execution policy.

Now you can do all the necessary operations without leaving the PowerShell window.

See what images are recorded in .wim:
<путь до Install-WindowsImage.ps1>–WIM<путь до файла.wim>(to simplify the commands, the script has been moved to the root of the C:\ drive. This is not necessary.):

Deploy the selected image to the previously created and attached virtual disk:
<путь до Install-WindowsImage.ps1>–WIM<путь до файла.wim>-Apply –Index -Destination<Диск>
Let's assume that the virtual disk is mounted as drive V:\. Then for our example the command will look like this:
C:\Install-WindowsImage.ps1 –WIM E:\Install.wim –Apply –Index 1 –Destination V:\
As in the case of using ImageX, all that remains is to wait for the operation to complete and unmount the virtual disk.

Adding Windows 8.1 installed on a VHD to the main system boot menu

A new bootable virtual disk with Windows 8.1 (or Windows 7/8), created using one of the methods described above, now needs to be connected to the main system bootloader menu.

If you manually add a section with the necessary records about the new boot option to the BCD system storage (how to do this was described in the section dedicated to editing BCD content, and it contains a description of the necessary commands), then the next attempt Windows startup 8.1 Preview from virtual disk will fail.

To run Windows 8.1, you need to update the bootloader files themselves (bootmgr, etc.), usually located in the first “System Reserved” partition of the physical hard drive.

You can do it like this. While in the main system, connect a ready-made virtual disk with Windows 8.1. Then, at an elevated command prompt, run the following command (assuming the virtual disk is mounted as V:\):
bcdboot V:\Windows /l ru-RU
As a result bcdboot will not only copy new files to system partition, but will also add to the Boot Configuration Data (BCD) store the systems of record responsible for booting new system from a virtual disk.

Now everything works and after a reboot a new graphical menu should appear:

Finally, you can change the order in which boot options are displayed and make the main system boot by default and change the selection timeout.

Installation on a virtual disk is interesting because it allows you to sections of hard disk to get an absolutely complete system (or several) for testing and evaluation on real hardware.

And again intelligibly, Alexander has a gift for rational and concise presentation. I also didn’t immediately appreciate the meaning of the manipulations, but after thinking I came to the conclusion that in some cases VHD is in demand.
Great article, thank you.

  1. How to install Windows 8 on a virtual disk? Hello admin! At first I wanted to, but then I changed my mind, there were too many body movements. First of all, you need to download and install a virtual machine, then configure it correctly and only then install Windows 8 into it. What if you install Windows 8 on a virtual disk, because this can be done almost immediately. Are there any difficulties in installing and then removing eight from the boot menu? Vlad84.
  2. Hello admin, I created a virtual disk in Windows 7 and installed Windows 8 on it and now only it boots, how can I restore the selection of operating systems when I start the computer, because I also need Windows 7.

How to install Windows 8 on a virtual disk

Hello, friends! The advantages of installing Windows 8 on a virtual disk are well known.
First of all, our reader is right, everything happens a little faster than in the case of a virtual machine and there is no need to install various updates and additions to the virtual machine.
Secondly, if you need to create temporary folders in a virtual machine, and use USB filters to work with flash drives, then in Windows 8 installed on a virtual disk, all the files on the hard disk will be available anyway.
Well, the most compelling argument is that when installed on a virtual disk, Windows 8 will work faster than in a virtual machine.

Let's install Windows 8 on a virtual disk together and see everything with our own eyes.

  • Note: Read our new articles on this topic "", I confess, this method is much simpler than the one described here.

Install Windows 8 on a virtual disk you can from Windows 7 or from Windows 8. If you don’t know where you can do it, follow the link and read our article.

For example, I have Windows 7 installed on my computer and I want to install Windows 8 as a second system on a virtual hard disk.
First you need to create a virtual disk in VHD format. Right-click on “Computer” and select “Manage”

"Disk Management".

"Action" and "Create virtual hard disk"

Click “Browse”.

In the explorer that appears, select the hard disk partition where we will create the virtual disk. My hard drive is divided into two partitions: C: and E:, I select the E: partition, give the file name for the Windows 8 virtual disk and click “Save”.

It is better to select “Dynamic expansion” for the virtual hard disk format and the size of the hard disk will expand as files accumulate in the virtual disk. I will choose the size 30 GB. OK.

We insert the installation disk with Windows 8 into the drive and boot from it; if you don’t know how to do this, read “”. I think you did it. Further.

Install.

We accept the license agreement. Custom: Windows installation only.

To open the command line, press Shift + F10.
On the command line we type
Diskpart
I created a virtual disk on the E: partition, so the next command will be like this.
select vdisk file= E:\Windows8.vhd
attach vdisk
exit
exit

Update

The usual installation of Windows 8 takes place. Assign a Name to the computer and Next.

Use standard settings.

If you don't want to set up a Microsoft account, disconnect the Internet.

Create a local account.

Enter your Name, Password and Password Hint. That's all.

Note: More details about

About virtual hard drives lovers of experiments with virtual machines. With the help of (hypervisors), you can create a virtual one inside a real computer - partly a clone of a real computer, partly with customizable parameters depending on the needs of the virtual OS being installed. However, a virtual disk can be created not only using hypervisors, but also using standard Windows 7 tools. Such a virtual disk can be used as a regular HDD partition or removable media.

1. Virtual hard disk – what is it?

The virtual hard disk in System Explorer will be no different from regular disk partitions.

But its internal structure is different - it is a file in the “.vhd” format, which must be attached to the system in order to display it as a separate disk partition. The principle is very similar to mounting disk images into the system. ".iso" file using special programs(such as Daemon Tools or Alcohol 120%) is mounted into a virtual drive and appears in Windows Explorer as a regular CD/DVD drive next to the real one, which is built into system unit or laptop hardware. Only in the case of a virtual disk file “.vhd” can you copy and transfer data to it, as to a regular disk partition. Well, you don't need any yet third party programs for mounting, everything is done, as already mentioned, using standard Windows tools.

The “.vhd” file of a virtual disk with all the data on it can be moved to another partition directory, to another disk partition, to removable media, to cloud storage. Or you can even transfer it to another computer and use it there.

2. What is a virtual disk used for?

A virtual disk, alas, in many cases will not replace a regular hard drive partition or external removable media. For example, you cannot boot from it, like from a flash drive, drive or HDD. And he to the average user It will rather serve as a separate place for conveniently organizing the internal space of the computer than bring practical benefit. So, on a virtual disk you can store some important data - valuable documents, professional developments, family photo and video collections. From time to time, from this virtual disk, as from a regular disk partition, you can do backups data and move them to cloud storage or removable media. Instead of backing up a virtual disk to cloud storage or removable media, you can move the archive of the “.vhd” file. If the external space is not limited by the limit of free space in the cloud or the small capacity of the flash drive, the “.vhd” file can be transferred in its original form - without archiving or backup.

But this is not the most unique and indispensable use of a virtual hard disk, since it is just as convenient to organize your files on a separate non-system disk partition or in a separate folder, periodically making backup copies or archives from them for transferring to cloud storage or to removable media. Virtual hard disks, as a rule, are used by fans of researching various operating systems, their versions and assemblies. So, you can install another one on the virtual hard disk Windows version(or Linux) and launch the second system on the computer by selecting it in the bootloader menu.

A virtual disk can be connected to both a physical and virtual OS installed on a virtual machine using programs, or. You can move files to a shared connected virtual disk on one system, and work with them on another.

A virtual disk can also be used as a storage medium for data backup, which appeared in system versions starting with the eighth.

3. Create and connect a virtual disk

To launch the standard disk management utility in Windows 7, 8, 8.1, use the command “ Execute" Let's select it in the classic menu " Start» Windows 7 or in the context menu on the corner Windows button in system version 8.1. In Windows 8, you can use the system search charm. The best way is to press the keys " Win+R" is a universal and fast way to call the command " Execute».

Enter:
diskmgmt.msc

And press the “ Enter».

The system disk management utility will launch. We need a menu at the top. In chapter " Action"Click the command to create a virtual disk.

A window for creating and attaching a virtual disk will appear, where you need to specify the location of the “.vhd” file, the size of the disk and its type - fixed or dynamic. The virtual disk file format is “.vhd” - set by default.

If we create a virtual disk to store some important data on it, we select a place that is not system disk, so as not to lose files in case of system failure. Fixed or dynamic virtual disk? To install the OS, it is better to choose a fixed virtual disk so that the dynamic disk does not “grow” with various system updates, cache or temporary files. By the way, if the “.vhd” file is located on the system disk, then the main system may not start due to lack of space. A dynamic one is better suited for storing your data - it will grow as more files are added.

Click " OK"after setting all parameters. Next, in the Disk Management utility window, the newly created virtual disk will appear as unallocated space.

Call on the newly created disk context menu(on the left side of his visual display where it says " Disc 1") and click the option " Initialize disk" This is necessary for it to be visible in Windows Explorer.

In the window that appears, without changing anything, click “ OK».

Now we again call the context menu on the created virtual disk, but on the right side of its visual display. We need a command to create a simple volume.

Then we simply follow the instructions of the launched wizard.

Select a letter of the English alphabet to represent the virtual disk in Windows Explorer.

We agree to the proposal to format the virtual disk. If the virtual disk will be used in Windows, you do not need to change the preinstalled NTFS file system.

The virtual disk in the disk management utility will now be displayed as a full-fledged partition (volume), and the system will detect the appearance of a virtual disk as a connection to removable media.

Open Windows Explorer (or a third-party file manager). And we will see that the virtual hard disk is displayed in the same row as the real disk partitions and removable media.

You can copy files to a virtual disk, delete them, create new ones on it - do everything you can do on regular disk partitions, flash drives or SD cards.

4. Manually attach a virtual disk to display in Windows Explorer

In order for a virtual disk, like other partitions, to be displayed in Windows Explorer, it must be attached. When created and initialized, this process occurs automatically. But a previously created virtual disk or one transferred from another computer must be attached manually for visibility by the system.

Let's launch system utility disk management. Open the menu “ Action" and select the command to attach a disk.

In the small window that appears, click the browse button and indicate the location of the “.vhd” file.

Now we can search for the virtual disk in Windows Explorer or in the file manager.

5. Detaching a virtual disk

If the virtual disk is no longer needed, you can disconnect it from the system and then delete the “.vhd” file itself.

Launch the system disk management utility. On the left side of the visual display of the virtual disk, call up the context menu and select the command to detach the virtual disk.

We confirm our action in the small program window that appears.

In this window you can see the path to the “.vhd” file, if suddenly over time you forget its location on the real disk. Now all that remains is to delete the “.vhd” file itself.

That’s it – the virtual disk has been removed from the computer.

Did this article help you?