Grub can't detect USB

This is for discussing general topics about how to use VirtualBox.
Post Reply
vboli
Posts: 3
Joined: 29. Apr 2017, 13:17

Grub can't detect USB

Post by vboli »

Hi,
i'm using VirtualBox 5.1.22. I created a VM and installed Ubuntu 17.04 (with Grub) on it. I put another linux distro on an USB to start from it via Grub.
I clicked on my VM -> Settings -> USB -> Enable USB Controller -> USB2 (EHCI) and checked my USB in the list.
Then i started my VM and pressed "ESC" while in Grub. After entering the command line with "c" i type

Code: Select all

ls -l
to list my disks but i only see

Code: Select all

(hd0) (hd0, msdos1)
I can't see my usb device. I also installed the extension pack to be able to select the USB2 (EHCI) option in the USB Settings but nothing changed.
Is this a virtualbox problem?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Grub can't detect USB

Post by mpack »

The VirtualBox BIOS does not provide USB boot support. USB drivers are loaded by the guest OS after boot, not pre-boot by the VirtualBox BIOS.
vboli
Posts: 3
Joined: 29. Apr 2017, 13:17

Re: Grub can't detect USB

Post by vboli »

Ok i see, but if i'm at the bootloader (Grub2) already, shouldn't it behave like a physical system and detect my USB?
At this point the system should be able to load drivers shouldn't it?
I mean the disk (partition) the OS is running on, is been detected too.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Grub can't detect USB

Post by Perryg »

At this point the system should be able to load drivers shouldn't it?
At this point all that is started is the kernel AFAIK. can you even run lsusb and get a positive reply?
vboli
Posts: 3
Joined: 29. Apr 2017, 13:17

Re: Grub can't detect USB

Post by vboli »

When in the Grub2 bootloader menu, the kernel is NOT started yet! I want to select the kernel on my USB to start another distro other then the one installed on my VM disc.
lsusb command does not work in Grub2 bootloader.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Grub can't detect USB

Post by Perryg »

Since boot to USB is not in VBox BIOS the only way to get it to work is with device drivers. The only way around this AFAIK is by using RAW with the USB device and attach it as a drive not as a USB device.
While the following is not exactly the same the concept is and you should be able to modify it to your needs:
http://www.virtualbox.org/manual/ch09.html#rawdisk

By the way this is not totally accurate either:
"When in the Grub2 bootloader menu, the kernel is NOT started yet!"
A subset of the kernel is actually loaded in memory and passes control to the MBR so while it may seem that the kernel is not loaded to you is does to me. Otherwise you could boot to the grub screen with nothing but grub in the disk.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Grub can't detect USB

Post by mpack »

vboli wrote:Ok i see, but if i'm at the bootloader (Grub2) already, shouldn't it behave like a physical system and detect my USB?
It behaves exactly like a physical system which has no understanding of USB encoded in its BIOS. Is grub (meaning the entire environment running at that moment) capable of using USB devices without help? If yes then it can use a USB mass storage device. If no then it cant.
Post Reply