Installing windows on a flash drive via virtualbox. Installing AirSlax on a virtual machine. Working with WiFi. Connecting an external flash drive to a virtual machine




The article discusses the question of how to check whether a bootable flash drive works in VirtualBox. I will first install and test the functionality of several flash drives with different operating systems: Android, Kali Linux and Windows. After this, let’s check how functional the bootable USB flash drive is in VirtualBox.

I won’t rant for a long time about how convenient a mobile operating flash drive is, which you always carry with you. Fortunately, in order to always have any of the OS with you, you only need one device - a USB drive. And a computer on which we will be allowed to run a flash drive. The rest is details.

But immediately after creating a flash drive with a wearable OS, it needs to be tested. The VirtualBox virtual machine is quite suitable for this. However, for some, the process of creating a bootable USB flash drive in VB poses a slight difficulty. No wonder - the function has not yet been put into the graphical interface by the developers, although it has been absolutely functional for a long time.

What do we need?

  • USB flash drive with OS installed
  • virtual platform VirtualBox

We will work from the host Windows.

ATTENTION. All open VirtualBox windows CLOSE

Flash drive to the port. diskmgmt.msc from string Execute we get into the Disk Management console in Windows. Let's see where your flash drive is in the list of disks. It will be easy to detect: the corresponding size and a different serial number (Windows numbers physical disks, let me remind you, starting with 0 ). I have one HDD ( Disk 0) and flash drive ( Disc 1):

Actually, we only need a number, the serial number of the disk. 1 - let's remember it; it will appear a little later at the end of the command to create the VMDK virtual machine disk file for the flash drive being tested.

Let's launch. In it we go to the directory with the installed virtual platform:

Cd %programfiles%\Oracle\VirtualBox

and give the command to create a virtual machine disk file VMDK for our flash drive in the root of drive C (the file name and location path can be anything):

VBoxManage internalcommands createrawvmdk -filename C:\flash drive.vmdk-rawdisk\\.\PhysicalDrive 1

Let's use Windows Explorer and look at the file to see if it's in place:

where will he go...

It's time for the virtual machine. Let's run it as administrator. And create a new machine like this, pointing to the created file flash drive.vmdk:

Let's launch. A bootable USB flash drive in VirtualBox with Android on board works:

I would like to immediately draw your attention to the fact that in the virtual machine settings in the section Carriers The first boot device should be the VMDK virtual machine disk file you created. This is a mandatory condition if you want to not only test the flash drive as a LiveCD media, but also want to install the system on a virtual machine to fully test its functionality as an installation flash drive. But for this, no matter what OS you try to install, you you will need a virtual hard disk for it. It's easy to create it in the same menu Carriers, by clicking on the icon Add a hard drive. And when installing the OS on the virtual HDD in VirtualBox, point to it. For Android I chose this:

What should you pay attention to?

  • If you have any questions about installing Android on your computer, please refer to the link of the same name in the paragraph above.
  • The sizes of the virtual disk when installing the OS are different, but we are testing a flash drive, which means we take minimum requirements. But I advise you not to skimp on performance characteristics (take more video and RAM volumes) in order to avoid problems during installation and not harm the performance of your bootable flash drive.
  • After installing the OS on a virtual disk in VirtualBox from a flash drive, the file flash drive.vmdk must be REMOVED FROM the LIST of virtual media (otherwise loading from a flash drive will haunt you in a circle).
May 19, 2015 at 12:33 pm

Installing AirSlax on a virtual machine. Working with WiFi

  • System administration

I once ran BackTrack r5 on VirtualBox, but I couldn’t do anything, because it requires a Wi-Fi Adapter, and the adapter built into my laptop was seen as Ethernet, so it’s impossible to work through it. You cannot enable monitoring mode on it.

I searched a bunch of sites on the Internet and found nothing. I decided to start digging myself. And I succeeded. I’ll say right away that I didn’t install AirSlax to hack other people’s WiFi networks. I needed to find out who is connected to my network, but that’s not about that now.

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

Those who know how to install AirSlax on VirtualBox can skip this and start reading about setting up a USB WiFi adapter.

Let's start.

Step 1: Prepare the virtual machine in VirtualBox

Oh, by the way, why VirtualBox and not VMWare?
There are several reasons:

1. I haven’t fully understood VMWare, but I have experience with VirtualBox.
2. I couldn't run AirSlax on VMWare

Let's get started.

1.1 Enter a name for the virtual machine
1.2 Type Linux (Required 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 let's indicate the amount of allocated memory for the virtual machine

Specify the amount so that you have a couple of GB left for the main operating system, optimally like this:
- with 4 GB of RAM ~ 2 GB per virtual machine;
- with 8 GB of RAM ~ 4 GB per virtual machine;
- with 16 GB of RAM ~ 8 GB per virtual machine;
- with 32 GB or more, 8 is possible. It will be quite enough for her.

Since AirSlax contains the Porteus bootloader, installation on a real hard drive is not advisable. This bootloader will break your Windows bootloader.

Now, if you have not yet created a flash drive with AirSlax, then I described it here, and if the flash drive has already been created, then proceed to step 3

2. Preparing a flash drive

2.1 Downloading the original image

You can download the image from here. The link leads to Yandex disk.
If you don’t believe me, then go to the website www.airslax.ru and download from there yourself.

2.2 Copying the downloaded image to a flash drive

Copy the boot and porteus folders to the USB flash drive. After copying the files, go to the boot folder and open the porteus-installer-windows file:

When this window appears, press any key to install porteus bootloader to the media. Make sure you are not installing a bootloader on your hard drive:

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

Now I’ll explain why you need a flash drive, as mentioned above, Porteus bootloader can destroy your system bootloader, accordingly, by putting all the files in the iso, you won’t be able to run airslax without installing porteus bootloader.

Oh, by the way, regarding the hard drive for the virtual machine, select “Do not connect a virtual hard drive.” We will do this a little later.

Somewhere on the Internet I found an article on how to boot from a flash drive into virtualbox, maybe I even read it on this site, I don’t remember exactly.

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

In order for VirtualBox to work with a flash drive, you need to write down the path to the device, all the information in the vmdk file, how to do it.

To create we need:

1. VBoxManager (vboxmanage.exe - located in the folder with VirtualBOX)
2. DiskPart (system utility for working with disks and disk partitions)

I was able to create a regular bat file in the folder with VirtualBox, but I didn’t have enough rights to create a vmdk file, the program required administrator rights, I had to do it through the command line (cmd).

I will describe how to do it via the command line, but if you want to make a bat file, then just copy the lines and edit them a little to your own.

3.1 Setting up booting VirtualBox from a flash drive

Open cmd (as administrator).

Enter the following: cd path to VirtualBox (for me it’s: “C:\Program Files\Oracle\VirtualBox”). After
VboxManage.exe internalcommands createrawvmdk -filename c:\vbox\usb.vmdk -rawdisk \\.\PhysicalDrive1

I'll write down the commands:
VboxManage.exe internalcommands createrawvmdk (this must be rewritten);
- filename (path to save the vmdk file);
- rawdisk (physical disk, flash drive) - how to find out what number, for this we need DiskPart.

Let's get started with DiskPart.
Open another cmd; administrator rights are not needed for this utility.

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

Enter list disk and find the flash drive in the list. Please note that my Disk 0 is a hard drive and Disk 1 is a flash drive. Since Disk 1 is a flash drive, the command in VboxManager will be like this:

Switch back to cmd with the command you entered.

VboxManage.exe internalcommands createrawvmdk -filename path for vmdk -rawdisk \\.\PhysicalDrive1 (in my case 1 is a flash drive).

Don't forget to create a folder where you will save the vmdk file. If everything goes well, you will see the inscription
RAW host disk access VMDK file filename.vmdk created successfully.

Now let's move on to setting up the virtual machine itself.

3.2 Connecting an external flash drive to a virtual machine

Right click on the virtual machine -> Settings

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

Click on the “Select existing disk” button and select your created vmdk file.

Now let's move on to connecting USB WiFi to AirSlax in VirtualBox:

Go to the USB menu and click on the green plus button and select your adapter, then click “OK” and run it.

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

Once the desktop appears, you can work.

Here is a screenshot of AirSlax in VirtualBox:

I hope I didn't waste so much time in vain. Good luck!

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

How to load a flash drive into Virtualbox and check whether it works or not

Hello! Today we will study boot from flash drive into Virtualbox. It is very comfortable. For example, you can test a bootable USB flash drive or see how a flash drive boots in a UEFI system (virtualbox has this option, but I haven’t tested it yet)
It turned out that everything is not so super simple. In Virtualbox without shamanism there is no such option. Therefore, we will do everything in the article step by step and you will be able to set booting from usb to Virtulbox.
First, open Command Prompt as an administrator. Type cmd then right key - open with administrator

Now we need to find out what number our flash drive is in the system. Insert the flash drive from which you want to boot into Virtualbox into your computer. Now in the command line we enter, first diskpart , then list disk


As you can see, my flash drive from which I want to boot is number 2. Remember this will be useful to you.
Now, we need to create a virtual hard disk file, only in our case it will be our flash drive. That is, our task is to create an image, which we can then specify in the Virtualbox settings.
To do this, first of all you must know where exactly Virtualbox is installed. If you installed your Virtuablox in a standard folder, then this folder is C:Program FilesOracleVirtualBox. It’s better to come in and check because this is important for the next steps.


Now run the command line as administrator again. Enter:
First cd C:Program FilesOracleVirtualBox(press Enter)


Now
VBoxManage internalcommands createrawvmdk -filename C:USB-download-virtualbox.vmdk -rawdisk \.PhysicalDrive2

Where is PhysicalDrive2 because my flash drive is number 2, in your case the number is yours. C:USB-download-virtualbox.vmdk is the path and name of the .vmdk file (the virtual file of our flash drive). 30 seconds after pressing Enter, a message should appear that the .vmdk was created successfully.


Great, let's move on. Now we need to boot from our flash drive image file. Exit Virtualbox. We launch it again, only with the help of the administrator. If you skip this step there will be an error when selecting our file


Open using Virtualbox admin

Now, in the settings of the new machine, where will we boot from flash drive in Virtualbox, go to Configure – Media – Where are the IDE controllers pr. cl. mice - Add a hard driveSelect existing disk. Select USB-download-virtualbox.vmdk. Click OK.


The most interesting thing is that when I chose to boot as a hard drive, I got an error. Missing Mbr helper. That's why I put it as CD-rom. I hope there will be no errors during installation. I'll definitely write it down here.
So I wrote it down for you video where everything is clear and visible and everything comes out. By the way, you can set up an external hdd in the same way if it is bootable. Thank you for your attention!

Errors and solution for booting from USB to Virtualbox. Missing MBR Helper.


At first I thought, as you probably did, that the boot record was corrupted. But how can this be if the bootable flash drive works everywhere (it has been tested 100 times in practice), but not in Virtualbox. And on my flash drive there are all the tools to solve almost all problems. Unless she doesn’t know how to repair a vacuum cleaner =D. So, trial and error.
It should be set like this. I do not know why. But when I changed SATA1 to SATA0, this error disappeared for the same flash drive. By the way, after I set it to boot from the IDE (ala Sidir), not a single installer loaded for me, nothing. So I kept digging. This is how you need to set it to work without the Missing MBR Helper error.




I'm trying to install Xp. It came down to installing and partitioning the hard drive. Considering it's Xp. When it gets to this point without errors, the system will be 80 percent successful. I won't continue.


I'll start with 7. So far so good




Super. I'm trying to split the disk. Super. The Next button appears. I'm a master chef. I'll go have some coffee. I'm happy. Let's continue


And then bang. Error. Yes, as much as possible


An error occurred while the virtual machine was running! The error details are given below. You can try to correct the situation and resume the virtual machine.
The I/O cache encountered an error while updating data in medium “ahci-0-0” (rc=VERR_ACCESS_DENIED). Make sure there is enough free space on the disk and that the disk is working properly. The operation can be resumed afterwards. I thought maybe the cache should be enabled. I turn it on


Let's see. It seems to work. And bam again. Yes, what is it =D


I'm trying to run Live CD. Hooray. At least it worked. But, almost at boot time, the machine receives the interrupted status. Not at all what I thought =(. I’ve already figured it out in my head, now I’ll install the system and poke around through the flash drive. It’s a bummer...
In general, we can safely summarize

  1. I was never able to install the system from a flash drive, which means I won’t be able to show you the flash drive.
  2. Any LiveCD launched from a flash drive crashes before booting, and the Virtualbox machine goes out
  3. The method on how to load a flash drive from Virtualbox is suitable but NOT PRACTICAL
  4. If you have any suggestions, do you know how to install the system from a flash drive (from a multiboot flash drive on Virtualbox, write in the comments)
  5. The article is considered incomplete because it is not fully functional

All popular hypervisors for Windows - Hyper-V , VirtualBox , VMware– provide for the launch of virtual machines (VM) from boot ISO-images and flash drives. Launch VM with the latter, not in every case there will be a process without problems: without dancing with a tambourine from flash drives UEFI only run VM on the base BY EFI in programs VirtualBox And VMware. How can I make it easier to launch VMs from flash drives in other cases?


To do this, you can create a so-called virtual flash drive– all the contents of the real USB- transfer the media to a virtual hard disk and, accordingly, launch VM from him. But the contents must be transferred along with the structure of the physical flash drive - so that the virtual disk inherits all partitions, if there are several of them (for example, in the case of Mac OS or Chrome OS) , as well as boot device attributes (unless it's UEFI media) . This can be done in at least two ways, described below.

All actions in our case will be carried out with . In other virtualization programs, you must act in a similar way.

1. R-Drive Image program

The first way to create a virtual flash drive is to transfer the structure and contents of a real one. USB-media to a virtual disk using the program- backup. Open the parameters of the existing VM and click .

Add another disk.

We leave the controller type as default.

Let's create a new disk. We indicate its size: let it be approximately the same as the size of the flash drive, but still be slightly different. This is necessary to avoid confusing devices during cloning. Save as one file.

Specify the placement path. Click.

Let's launch VM, connect a real flash drive to it. Install in the guest OS trial-program version . In its window we select "Copy Disk to Disk".

In the column "Source" choose a real flash drive. In the column "Receiver"— the newly created virtual disk.

AND - "Begin".

Once cloning is complete, exit the program.

Now in the explorer guest OS We now have two identical devices.

We can disconnect the real flash drive from VM. Likewise, we can disconnect a virtual disk from the current one 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's capabilities Rufus 3.1. In the updated version 3.x this program, in addition to the existing functions for creating bootloaders USB-devices, learned to clone real flash drives into files VHD. A VHD compatible with Hyper-V, and with VirtualBox, And VMware. Let's launch Rufus 3.1 on the host system. Select the one you need USB-carrier, if several are connected, in the column "Device". Next, press the button in the form of a floppy disk.

Specify the file storage path VHD .

We wait for the operation to complete and close Rufus.

3. Connecting a virtual flash drive and launching from it

So, the virtual flash drive has been created, how to connect it to the VM and, accordingly, launch it?

In parameters VM click HDD.

Select an existing one.

In the Explorer window, specify the path to the file storage folder VHD. In the file display column we put . And click our virtual VHD-flash drive.

On EFI-cars enter BIOS– either use the button on the hypervisor toolbar, or at startup VM press F2.

In the bootloader window select Hard Drive with the number under which it is listed in the general list of connected virtual disks, but calculated from scratch. In our case, the virtual flash drive is the second disk VM, because in EFI-in the firmware it is listed as Hard Drive 1.0.

On regular VM, created on the basis of emulation BIOS Legacy to boot from a virtual flash drive, you need to in the parameters VM specify it as the first hard drive. You need to remove all existing disks on the machine and add them again, specifying the virtual flash drive first.

In this article I would like to touch on the topic of installing Windows OS on a VirtualBox virtual machine from a flash drive. If you work with the VirtualBox program, then you will have a reason to install the operating system from a flash drive, in principle, if you opened this article, then you already have it.

For this operation we need additional software called Virtual Machine USB Boot, you can download the program from the official website by following the link http://reboot.pro/files/download/339-virtual-machine-usb-boot/. From the developer’s website you can download both a regular installation version of the program and a portable version that does not require installation. I downloaded the portable one.

The program has been downloaded, unpack and run.

In the program window that opens, click Add.

In point VM name we need to select the virtual machine from which our flash drive should boot.

My VirtualBox contains 5 virtual machines, this can be seen in the picture below.

I choose Windows 7, that is, at startup, this virtual machine will boot from a flash drive.

In point Drive to add and boot, select the flash drive that we want to connect to the virtual machine.

In the information window that appears, click OK.

Select the tab that appears in the list and click Start. Just before you press the button start Make sure VirualBox is not running.

In the information window that appears, click OK again. After this, the virtual machine starts from the flash drive as we wanted.

Problem occurring during startup.

In versions of VirtualBox starting from 5.0, an error occurs when starting from the Virtual Machine USB Boot program FATAL: No bootable medium found! System halted, this error occurs because the Virtual Machine USB Boot program does not automatically create an IDE controller in VitualBox 5 versions; without it, it will not be possible to connect the vmdk file created by the program, which in turn is responsible for connecting to our flash drive.

To resolve the error, we need to manually create an IDE controller in VirtualBox. We go into the program, select the virtual machine with which we want to boot (in my case it’s Windows 7), then go to settings -> media, in point information carriers, at the bottom, click on the button with a green cross (as shown in the picture below) and select the item Add an IDE controller.

Launch the Virtual Machine USB Boot program again, click Start.

Now the program runs from the flash drive without any errors.

And as we can see, the file with the vmdk extension was successfully connected to the IDE controller.

ABOUTGive your opinion about this article, and of course, ask your questions if something suddenly goes wrong for you.

Thank you for your attention!