Is it possible to install a virtual machine on the USB flash drive. Installing Airslax on a virtual machine. Work with WiFi. Disable account control

I have a computer with which I constantly work and having fun, Windows 7 is spinning as an operating system on it. I also have a portable USB Winchester to which I was undermined as a boot OS Ubuntu Linux. I use it as a "rescue" Operation, such as Live CD, and sometimes I work in it. In general, I thought that it would not be bad to be able to upload this axis in VirtualBox. Ponasoscrebav of various instructions from manuals and internets I made up my recipe, how to do it.

And so, launch in VirtualBox Ubuntu Linux installed on USB HDD as ordinary virtual Machine. By the way, for flash drives this recipe is also suitable.

### is given: * computer with windows 7 x64 * boot USB HDD with Ubuntu 12.04TLS

###A task:

Start Ubuntu installed on USB Hard Disk Drive, inside VirtualBox and use two systems in parallel.

###Decision:

For starters need run a command line (console, cmd.exe) on behalf of the administrator (!!! necessarily !!!)If you use Windows 7 or Vista.

And perform the following three commands in it. C: CD "% ProgramFiles% \\ .. \\ Program Files \\ Oracle \\ VirtualBox \\" VBOXMANAGE INTERNALCOMMANDS CREATERAWVMDK -FILENAME "% UserProfile% \\ USB-HDD-Connector.vmdk" -ReWDisk \\\\. \\ PhysicalDrive1

### Now consider these commands more:

The first line will be needed if the current path in the console begins with a partition that is installed in which your VirtualBox is installed.

The second line determines the directory in which the following commands will be executed. In my case, this is C: \\ Program Files \\ Oracle \\ VirtualBox \\ ", since my virtualization program is installed in the folder that the developers are offered to install.

The third command creates a file USB-HDD-Connector.vmdkwhich will bind our outdoor HDD with the operating system and VirtualBox. It is this file that will need to add as the primary disk to download your virtual machine. BUT! Before performing this command, you need to clarify the number under which your external hDD Known system.

### How to find out the number of the disk from which you want to load?

And very simple! To do this, open the "Computer Management" panel section "Disk Management". You can call the panel in two ways:

Click right-click Mice on the "My Computer" label and select "Control" in the menu menu; - Run the command `% windir% \\ system32 \\ compmgmt.msc / s`. To do this click Win + R., enter this command and click eNTER.

Personally, I prefer the second option, though you need to remember this command for this. Fortunately, I once added to the TotalCommander toolbar, which opens the "Computer Management" window. What, then I distracted ...

In the section "Disk Management" We are looking for your disc. Disc 0, disk 1, disc 2 ... numbers - this is the number of disks.

In my case - it was Disk 1.. So, in the above team there is such a substring \\\\. \\ PhysicalDrive1. Last digit Here must match the disk number that you learned in the computer control panel.

Another point I would like to describe is a place where the file you need will be created. In my version -% UserProfile% \\ USB-HDD-Connector.vmdk - this means that in the% UserProfile% folder (This is a system variable Windows that will be replaced by an interpreter command line On the path to the user folder, under which you are logged in in the system) USB-HDD-Connector.vmdk file will be created. Of course, you can use Hell any file convenient to you and the path, but if there are spaces in this line, it is necessary to enter into quotes. Otherwise, the interpreter will perceive this gap as a transition to the next instruction.

### As a result in your console, there is something like the following picture:

In case of successful execution of the command and creating a communication file, you will see the answer: Raw Host Disk Access VMDK File% UserPofile% \\ USB-HDD-Connector.vmdk Created SuccessFully. Woob. It remains the case for small - create a virtual machine and select the file as a hard disk that we just created. Oh yeah ... and turn it on as a "primary master".

Immediately I would like to warn that VirtualBox can swear on the fact that this disk does not exist and the virtual machine will not start. This is due to the fact that the user under whom you are authorized in the system are not right. To get around this trouble, run your VirtualBox on behalf of the administrator.

All popular hypervisors for Windows - Hyper-V. , VirtualBox. , Vmware. - Provide the launch of virtual machines (VM) With loading ISO. - Drains and flash drives. Running Vm Since the latter, not in each case will be a process without problems: without dancing with a tambourine with flash drives UEFI Run only Vm on the base BY EFI in programs VirtualBox. and Vmware.. How to simplify the launch of VM from flash drives in other cases?


To do this, you can create the so-called virtual flash drive - all the contents of the real USB transfers to transfer to a virtual hard disk and, accordingly, run Vm from him. But the contents must be transferred along with the structure of the physical flash drive - so that the virtual disk inherit all sections if there are several (for example, in the case of Mac OS or Chrome OS) , as well as the attributes of the boot device (If this is not a UEFI carrier) . You can do this at least two ways described below.

All actions in our case will be held with. In other virtualization programs, it is necessary to act by analogy.

1. R-DRIVE Image program

The first way to create a virtual flash drive is to transfer the structure and content of the real USB -Conitor to a virtual disk using the program bacpee. Open the parameters of existing Vm and click.

Add another disk.

The controller type is left by default.

Create a new disk. We indicate its size: let it be about the same as the size of the flash drive, but let few even be different. It is necessary to not confuse the device when cloning. Save in the form of one file.

Indicate the placement path. Click

Run Vm, We connect a real flash drive to it. In the guest OS install trial.-Eversion program . In its window choose "Copy disk disc".

In graf "A source" Choose a real flash drive. In graf "Receiver" - just created virtual disk.

And - "To begin".

Upon completion of cloning, we leave the program.

Now in the guest's guide OS. We have two identical devices.

We can turn off the real flash drive from Vm. As well as we can disable the virtual disk from the current Vm and use it to launch others Vm.

2. RUFUS program

The second way to create a virtual flash drive is to use the program features RUFUS 3.1.. In the updated version 3.x This program, in the appendage to the existing functions of creating boot USB -dunches, learned to clone real flash drives to files VHD. . BUT VHD. Compatible and S. Hyper-V., and S. VirtualBox., I. Vmware.. Run RUFUS 3.1. in the host system. We choose the desired USB -Oneer if they are somewhat connected, in the column "Device". Next, click the button in the form of a diskette.

Specify the file storage path VHD. .

We are waiting for the completion of the operation and close Rufus..

3. Connecting a virtual flash drive and starting with it

So, the virtual flash drive is created, how to connect it to VM and, accordingly, run?

In parameters Vm Click hDD.

Choose an existing one.

In the conductor window, specify the path to the file storage folder VHD. . In the file display column set. And click our virtual VHD. -The cover.

On the EFI - Machines enter B. Bios. - either use the button on the hypervisor toolbar or when starting Vm Click F2.

In the bootloader window, choose Hard Drive. With the number under which it is listed in the overall list of connected virtual disks, but in calculating from zero. In our case, the virtual flash drive is the second disk Vmbecause B. EFI -Scheck it is as well as Hard Drive 1.0.

On ordinary Vmcreated on the basis of emulation Bios. Legacy to boot from the virtual flash drive, you need in parameters Vm Specify it with the first hard disk. You need to remove all existing drives of the machine and add them again by specifying the virtual USB flash drive.

19 May 2015 at 12:33

Installing Airslax on a virtual machine. Working with WiFi.

  • System administration

Somehow I started backtrack R5 on VirtualBox, but I could not do anything, as it is necessary for it a Wi-Fi adapter, and the adapter built into my laptop it saw as an Ethernet, accordingly it is impossible to work through it. Do not turn on the monitoring mode.

Toping a bunch of sites on the Internet, I did not find anything. I decided to start digging myself. And I did it. I'll say right away, I installed the airslax I am not to hack out wiFi networks. I needed to know who was connected to my network, but now it's not about that.

I will describe the whole process, namely:
1. Installing Airslax on VirtualBox
2. Preparation of flash drive
3. Setting up a virtual machine
4 work with USB WiFi adapter

Knowing how to install Airslax on VirtualBox can skip it and start reading about the setting of a USB WiFi adapter.

Let's start.

Step 1: Prepare a virtual machine in VirtualBox

Yes, by the way, why exactly VirtualBox, not VMware?
There are several reasons:

1. With VMware I did not fully understand, but I have experience with VirtualBox.
2. I could not run Airslax on VMware

Let's proceed.

1.1 Enter the name for the virtual machine
1.2 Type Linux (MUST LINUX)
1.3 version, at your discretion, but I chose Linux 2.6 / 3.x 64bit (if you have a 32-bit operating system, then select 32 Bit)

Now specify the number of memory allocated for the virtual machine

Specify such a quantity so that in the reserve you have a pair of GB to the main operating systemOptimally:
- at 4 GB of RAM ~ 2 GB per virtual machine;
- at 8 GB of RAM ~ 4 GB per virtual machine;
- at 16 GB of RAM ~ 8 GB per virtual machine;
- at 32 GB or more, it is possible to 8. She is enough.

Since the PORTEUS BOOTLOADER is present in the Airslax, the installation on the real hard disk is not desirable. This bootloader will break you Windows bootloader.

Now, if you have not yet created a flash drive with Airslax, I described it here, and if the flash drive is already created, then proceed to 3 points

2. Preparation of flash drive

2.1 Downloading the original image

You can download the image from here. The link leads to Yandex drive.
If you do not believe, go to the site www.airslax.ru and download from there yourself.

2.2 Copying the downloaded image on the USB flash drive

Copy the Boot and Porteus folders on the USB flash drive. After copying files, go to the BOOT folder and open the Porteus-Installer-Windows file:

When this window appears, click on any key to install Porteus Bootloader onto the media. Make sure you do not install the bootloader to your hard drive:

Now again, press any key to exit the installer. That's all, the flash drive is ready and Airslax is already present on the flash drive.

Now I will explain why you need a flash drive, as mentioned above, the porteus bootloader can handle your system bootloader, according to all the files in ISO, you do not start the airslax without installing the porteus bootloader.

Yes, by the way, at the expense of a hard disk for a virtual machine, select "Do not connect a virtual hard disk." This we will do a little later.

Somewhere on the Internet, I found an article, how to boot from a flash drive in VirtualBox, maybe even read on this site, I don't remember exactly.

3. Setting up a virtual machine and setting up loading from a flash drive for VirtualBox

To allow VirtualBox to work with a flash drive, you need to record the path to the device, all the information in the VMDK file, how to do it.

To create we need:

1. VBoxManager (vboxmanage.exe - is located in the VirtualBox folder)
2. DiskPart (System utility for working with disks, disc partitions)

Create a regular BAT file in the folder with VirtualBox I did it, but did not have enough rights to create a VMDK file, the program required the administrator rights, I had to do through the command line (CMD).

I will describe how to do through the command line, but if you want to do bAT file, just copy the lines and edit them a little on your own.

3.1 Setting up the download VirtualBox from a flash drive

Open CMD (on behalf of the administrator).

Enter the following: CD path to VirtualBox (I have it: "C: \\ Program Files \\ Oracle \\ VirtualBox"). Later
Vboxmanage.exe InternalCommands CreateRawvmdk -FileName C: \\ Vbox \\ USB.VMDK -REWDisk \\\\. \\ PhysicalDrive1

Sick teams:
VboxManage.exe InternalCommands CreateRawvmdk (this is necessary to rewrite);
- FileName (path to save the VMDK file);
- Rawdisk ( physical disk, USBA) - How to find out what number, for this we need DiskPart.

Getting to work with diskpart.
Open another CMD, you do not need administrator rights for this utility.

Enter diskpart if you entered correctly, you will see this window:

Enter List Disk and find the flash drive in the list. Note, since I have a 0 drive - this is a hard drive, and the disk 1 is a flash drive. Since the disk 1 is a flash drive, the team in VboxManager will be like this:

Switch back to CMD with command you entered.

Vboxmanage.exe InternalCommands CreateRawvmdk -FileName Path for VMDK -ReWDisk \\\\. \\ PhysicalDrive1 (In my case 1 - USB flash drive).

Do not forget to create a folder to which you save the VMDK file. If everything goes fine, you will see the inscription
Raw Host Disk Access Vmdk File File .Vmdk Created SuccessFully.

Now let's go directly to the configuration of the virtual machine itself.

3.2 Connecting an external flash drive with a virtual machine

Right-click on the Virtual Machine -\u003e Settings

Select "Media" in the list on the left. Then click on the button highlighted in red in the picture.

Click on the "Select Existing Disc" button and select your VMDK file created.

Now go to K. uSB connection WiFi to Airslax in VirtualBox:

Go to the USB menu and click on the button with a green plus and select your adapter, after clicking "OK" and run.

If everything is configured correctly, you will see a blue menu, select Graphic Mode and wait.

How the desktop appears, you can work.

Here is a screenshot of the Airslax in VirtualBox:

I hope I did not kill so much time. Good luck!

This article was created for informational purposes. The author of the article is not responsible for the damage to this program.

In this note, I will tell you how to connect a USB disk into a virtual machine so that the guest system perceives it as an ordinary hard drive.

This trick will allow not only to load from the installation USB - that, in my opinion, it is rather pointless, because the flash drive is recorded .iso. The image that is much easier to connect to virtual Computer in VirtualBox. If you connect a USB disk or flash drive to a guest system as a regular disk, you can make such interesting things like:

If you do not have the ability to connect the SATA disk directly to the computer - for example, to the laptop - but you really need to boot in the operating system, which is deployed on it, the trick described here will help it: Connect the SATA disk to the computer through a USB, and Then the USB disk connect to the virtual machine as a regular disk, as shown in this manual.

Regarding the second item - installing Windows on USB media - If you want to install Linux on a USB flash drive (do not write a Live-image, namely install a full-fledged system), then for installation it is not necessary to do the trick shown here - because Linux is perfectly installed on the portable medium. But Windows has a ban to install on USB discs and flash drives.

I will show how to boot from USB in Windows and Linux. The principle is the same in both of these operating systems, but the teams are slightly distinguished due to the specifics of the OS.

As in VirtualBox, boot from USB in Windows

Connect the USB USB flash drive or disk to the computer. Then click Win + R. and execute diskmgmt.msc..

Find your USB flash drive and remember the number of the disk:

For example, on my screenshot, the flash drive has number 2.

Close all VirtualBox windows if they are open.

In the window that opens, enter:

Now go to the folder where you have the VirtualBox. If this program is installed in the default directory, then the command for the transition:

CD% PROGRAMFILES% \\ Oracle \\ VirtualBox

If you choose another location for VirtualBox, then edit the previous command accordingly.

Now in the command prompt insert next commandin which replace # On the number of the disk, which we looked just above, then press ENTER:

VboxManage InternalCommands CreateRawvmdk -Filename C: \\ USB.VMDK -REWDisk \\\\. \\ PhysicalDrive #

For example, I have this second disk, then the team looks like this:

VboxManage InternalCommands CreateRawvmdk -Filename C: \\ USB.VMDK -REWDisk \\\\. \\ PhysicalDrive2

If everything went successfully, an inscription should appear:

Raw Host Disk Access Vmdk File C: \\ USB.Vmdk Created SuccessFully.

Note that you can replace C: \\ USB.VMDK For any location of the file at will.

This command creates a virtual machine disk file (VMDK) indicating the physical disk that you have chosen. When you download the VMDK file as a disk in VirtualBox, then VirtualBox will actually have access to the physical disk.

Now open the VirtualBox from the administrator is necessary, otherwise it will not work as it should. To do this, click Start, dial VirtualBox. and select " Run on the name of the administrator»:

VirtualBox can have access to raw disk devices only with administrator rights.

Now in VirtualBox, create a new virtual machine, select the appropriate operating system and when it comes to the selection hard disk, instead of creating a new one, select Use an existing virtual hard drive:

Now open the file C: \\ USB.VMDK (or the other if you saved it else or under a different name):

Load your virtual machine, now your USB flash drive it should see as the most common hard disk. That is, if this is a correctly recorded boot disk or flash drive, then the system is booting from it.

note that USB device It must be the first hard disk in your VirtualBox virtual machine, otherwise the download will not happen. If you connect a new USB disk to an existing machine, then try changing the procedure of media in the settings of this machine, or select the appropriate disk at the beginning of the download.

How in VirtualBox boot from USB in Linux

To understand the principle, read the previous section about Windows. In Linux to find out the disk USB name, execute the command:

Sudo Fdisk -L.

In my case the disk name / dev / sdb.

To create a virtual disk file, indicating a real disk, execute the type command:

Sudo Vboxmanage InternalCommands CreateRawvmdk -FileName /root/USB.VMDK -ROOWDisk / Dev / SD

Where instead # Enter the letter of the corresponding disk. Example for my conditions:

Sudo VBoxManage InternalCommands CreateRawvmdk -Filename /root/USB.VMDK -ROOWDisk / Dev / SDB

In this team you can replace /root/usb.vmdk to another location at your discretion.

To start VirtualBox with administrator rights, run the command:

Sudo VirtualBox.

Everything else is to create a virtual machine and choosing an existing virtual disk as a hard disk - exactly as in Windows.

Engaged in system administration, I often have to use virtual machines Type Oracle WM VirtualBox. and WMWare Workstation.. VirtualBox \\ "Ohm I use more often due to the fact that it is easier for single launches and easier. There was a need to upload a virtual machine with a real USB flash drive, in this case, to test the freshly plane boot flash drive. But there is one trouble - via the basic interface of the VirtualBox program cannot be loaded by a virtual machine from a physical USB disk, however, there is a way to solve such a task. Here about this way and will be discussed in the article.

To download VirtualBox virtual machine from an external USB disk, you need to create uSB clone disk as * .vmdk fileThrough which the VirtualBox host will be communicated with the physical external USB disk. Such a file will occupy a few kilobytes, because It contains only data for communication with a USB disk.

1. Create a file that serves as a bridge between VirtualBox and USB disk.

To create a * .vmdk file, there is a VBoxManage.exe utility, which is included in the standard VirtualBox composition, so it is not necessary to download it separately.

So, to create such a file, you must execute the following command in the command line window, applying the path to the VirtualBox directory to your:

"C: \\\\ Program Files \\\\ Oracle \\\\ VirtualBox \\\\ vboxManage.exe" INTERNALCOMMANDS CREATERAWVMDK -FILENAME C: \\\\ TEMP \\\\ USB.VMDK -REWDisk \\\\\\\\. \\\\ PhysicalDrive2 -Register

Here you should pay attention to two parameters:

To find out the number of the external USB disk with which you should connect the file (usually external USB HDD under the number 1 if only one hard disk is installed), you can be brutally high in "Control Panel → Administration → Computer Management → Disks Management".

Now it remains to configure the VirtualBox host to download from the newly created virtual disk.

2. Installation in VirtualBox * .vmdk file as a boot disk.

First you need to add the created USB.VMDK to the list hard disks In the virtual media manager VirtualBox.

Next, go to the "Properties" of the virtual machine (which must be downloaded from USB external disk) and in the "Media" section, install the added virtual USB.VMDK hard drive in Slot "Primary master IDE", as in the screenshot.

Ready, you can now download a virtual machine from an external USB disk.


Top.