Talk:VirtualBox

From ArchWiki
Latest comment: 18 April 2023 by Antage in topic Binding to a physical drive

NS_ERROR_FAILURE (0x80004005)

I found out ~/.config/VirtualBox/VirtualBox.xml was empty (size 0 Bytes) while ~/.config/VirtualBox/VirtualBox.xml-prev was not. A simple copy of the "-prev" to the original fixed this issue for me: cp ~/.config/VirtualBox/VirtualBox.xml-prev ~/.config/VirtualBox/VirtualBox.xml —This unsigned comment is by Costis (talk) 11 January 2015 20:44. Please sign your posts with ~~~~!

Cannot find the cause of the problem. Anyway, if ~/.config/VirtualBox/VirtualBox.xml has a 0 byte size, VirtualBox will complain at startup and will say it cannot find proper XML tags. -- wget (talk) 21:26, 12 January 2015 (UTC)Reply[reply]

Binding to a physical drive

In the near future, I'm gonna make some changes to this section VirtualBox#Create a raw disk .vmdk image. The latter advertises the use of the disk group while it is clearly unavailable anymore since Arch migrated to systemd. And the command VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sdb -register does not recognize the -register argument --> replacing each occurrences in the article where this statement appears is needed. Comments on these 2 topics are welcomed and even needed for me to ensure I'm right. -- wget (talk) 08:13, 5 February 2015 (UTC)Reply[reply]

I make a box with a raw disk and the recipe in wiki doesn't work.

  1. newgrp doesn't change groups for VirtualBox, you need to restart gdm.service.
  2. Command to create vmdk file from VirtualBox docs: VBoxManage createmedium disk --filename raw-disk.vmdk --format=VMDK --variant RawDisk --property RawDrive=/dev/sdc (change /dev/sdc to your disk).

Antage (talk) 22:02, 18 April 2023 (UTC)Reply[reply]

modprobe: ERROR: could not insert 'vboxguest': No such device

My system is dual boot for windows 7 & Arch Linux. Is it possible to remove the error message? In windows 7, I use virtualbox to run the same file system of Archlinux. So, my /etc/modules-load.d/virtualbox.conf is like

 # for host
 vboxdrv
 # for guest
 vboxvideo
 vboxguest
 vboxsf

It works well when I boot archlinux inside virtualbox. It shows systemd-modules-load.service failed when I boot directly.

 # systemctl status systemd-modules-load.service
 ● systemd-modules-load.service - Load Kernel Modules
    Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static; vendor preset: disabled)
    Active: failed (Result: exit-code) since Wed 2015-05-20 09:58:59 CST; 6min ago
      Docs: man:systemd-modules-load.service(8)
            man:modules-load.d(5)
   Process: 25784 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)
  Main PID: 25784 (code=exited, status=1/FAILURE)
 May 20 09:58:58 t64 systemd[1]: Starting Load Kernel Modules...
 May 20 09:58:59 t64 systemd-modules-load[25784]: Failed to insert 'vboxguest': No such device
 May 20 09:58:59 t64 systemd-modules-load[25784]: Failed to insert 'vboxsf': No such device
 May 20 09:58:59 t64 systemd[1]: systemd-modules-load.service: main process exited, code=exited, status=1/FAILURE
 May 20 09:58:59 t64 systemd[1]: Failed to start Load Kernel Modules.
 May 20 09:58:59 t64 systemd[1]: Unit systemd-modules-load.service entered failed state.
 May 20 09:58:59 t64 systemd[1]: systemd-modules-load.service failed.

The solution for this is to decide if you need guest or host. Probably you care only about host so feel free to remove anything related to vbox*guest:

 sudo pacman --remove --recursive virtualbox-guest-utils

(more on: forum:[SOLVED] ERROR: could not insert 'vboxguest': No such device ) Alexz (talk) 07:11, 26 December 2016 (UTC)Reply[reply]

Automounting Shared Folders also requires VBoxService to be enabled

On the wiki page section Load the Virtualbox kernel modules 2 the VBoxService is barely mentioned. It is written

"Alternatively, enable the vboxservice service which loads the modules and synchronizes the guest's system time with the host."

In my humble opinion it should state that this service is also required when you want to automount your shared folders. I would change it myself, but since I just joined the wiki, I feel I should discuss it before changing.

My suggested change would be something like

"Alternatively, enable the vboxservice service which loads the modules and synchronizes the guest's system time with the host. This service is also required if you wish to enable automounting of shared folders."

It should probably also be mentioned in the Automounting section.

Does anyone have any input or feedback on my somewhat limit suggestion?

This was mentioned in the article previously, but I removed it after testing that I was able to automount shared folders without the service running. Can you double check that the service is actually required? Silverhammermba (talk) 16:45, 1 July 2015 (UTC)Reply[reply]
When looking through the source code for vboxsf module I cannot find any trace of any code that would automount the devices. This is expected as the module is only responsible for registering the filesystem type and performing the mount when requested to do so. Then again, calling it required is not actually true since you could technically get around this by adding an entry to fstab. Or setting up a script that calls "mount -t vboxsf SHARED_FOLDER_NAME MOUNT_POINT". But without an action like enable the service, adding a fstab entry or any other automation techniques the automating should not happen. So maybe in the Automounting section we should mention this. Soderstrom (talk) 18:14, 1 July 2015 (UTC)Reply[reply]

Mount at boot - A better way?

I've just found my way here after trying to 'mount at boot' a vbox share. The "comment=systemd.automount" method seems like a bit of a hack, and leaves the 'mount' output looking a bit strange until the mount is triggered. Isn't there a cleaner way to make this work actually at boot? Maybe using a systemd service 'After=' specification? I tried to get it working but failed (systemd noob). There must be a way I think because the /media/sf_ mount happens magically around boot time. Anyway, not whinging, just trying to improve the world. Thought an expert might be able to see a neater solution. Cheers. Peterg4000 (talk) 11:51, 12 August 2015 (UTC)Reply[reply]

Solving smbus module load failure

A VirtualBox Guest apparently doesn't have an smbus, resulting in the appearance of the following message at the console at startup of the VM and in the journal:

 piix4_smbus 0000:00:07.0: SMBus base address uninitialized - upgrade BIOS or use force_addr=0xaddr

With the help of [1] I solved this by doing:

 echo 'blacklist i2c_piix4' > /etc/modprobe.d/modprobe.conf

Granting user rw access to all disks?

In Section VirtualBox#Create_a_VM_configuration_to_boot_from_the_physical_drive, we have, quote: "[putting user in disk group] way is the more elegant, let us proceed that way..."

Doesn't that mean any process running as the user now has complete write access to ALL raw disk devices?

Isn't that a rather bad idea? Kind of like a permanent su for the user, able to change any disk data at will.

A mechanism that (at the very least) only modified access to the disk in question seems preferable. -- Peterg4000 (talk) 14:22, 7 May 2016 (UTC)Reply[reply]

Suggestions for improvements on the installation guide

I have had problems troubleshooting the instalation of VMs after following this page. I am not an expert with VirtualBox so there are several concepts that are shown here without further explanation that I don't understand and that I don't even know if are optional or necessary steps.

I'll post these doubts here so maybe someone could add some explanations for newbies.

1. The Wiki starts explaining how to install host modules and guest modules but does not explain what they are or for what they are used for.

2. It is not clear which steps are necessary to have a working VM running, so I have to guess and that is confusing.

Also, some less important info that would be helpful (maybe a link to an appropriate doc would suffice):

1. What are "VirtualBox kernel modules" and why are they necessary (a link would be great)

2. Why would someone use a custom kernel and how can I be sure I am not using one?

And I think that's the most important stuff.

I should highlight that the most important point for me would be to make explicit which parts of the installation process are optional and when should I follow them. Since when something goes wrong I do not know if I missed some important step or if I did some step I shouldn't have.

Sadly I do not have the knowledge to write this myself =/.

Fox (talk) 18:43, 8 September 2017 (UTC)Reply[reply]

Automount should suggest adding user to group vboxsf

Users do not need to be in group vboxsf to access manually mounted vbox shares, in my experience. But they definitely do need to be in vboxsf to access auto-mounted shares, this should be corrected and made more explicit as following this myself led to confusion, thanks. —This unsigned comment is by Jgr (talk) 10:37, 22 March 2018‎. Please sign your posts with ~~~~!

EFI?

What are the advantages and disadvantages of using or not using EFI on a VBox guest? Should the main article list the most advantageous one and simply point to information on the other one? As it is it gave me decision-paralysis :( I wasn't even thinking on using it, but since the article mentions both methods, with the non default EFI first, i am now thinking i should have been using it. Gcb (talk) 17:11, 24 March 2020 (UTC)Reply[reply]

By default EFI mode is off for Linux VMs. As for whether you should enable it or not, that's a personal preference. To give one use case for EFI mode, if you're trying out Arch in VirtualBox before installing it on real hardware, you might want to use VirtualBox's EFI mode if you plan to install it for UEFI booting on real hardware. -- nl6720 (talk) 13:46, 25 March 2020 (UTC)Reply[reply]

Add a new top-level section

I have found a way to boot a single Windows installation from a dual-boot partition and from VirtualBox on a UEFI system. I believe this is worth adding as a new top-level section, since the process is substantially different from moving a native Windows intallation to a virtual machine. As far as I know, nobody else has done this, and I figured out the process myself via numerous documentation sources and a lot of trial-and-error. DCengineer (talk) 00:07, 31 August 2017 (UTC)Reply[reply]

Run a Windows partition in VirtualBox

Does some successfully did it? Can someone with the knowledge complete the missing steps? VirtualBox/Tips and tricks#Run a Windows partition in VirtualBox —This unsigned comment is by Noraj (talk) 10:48, 7 March 2019 (UTC). Please sign your posts with ~~~~!Reply[reply]

No `VBoxManage internalcommands createrawvmdk -register` switch

I've tried to reproduce a hint from VirtualBox/Tips_and_tricks#Run_a_native_Arch_Linux_installation_inside_VirtualBox with VirtualBox 6.0.14r132055, it shows this error:

Oracle VM VirtualBox Command Line Management Interface Version 6.0.14
(C) 2005-2019 Oracle Corporation
All rights reserved.

Usage: VBoxManage internalcommands <command> [command arguments]

Commands:

  createrawvmdk -filename <filename> -rawdisk <diskname>
                [-partitions <list of partition numbers> [-mbr <filename>] ]
                [-relative]
       Creates a new VMDK image which gives access to an entire host disk (if
       the parameter -partitions is not specified) or some partitions of a
       host disk. If access to individual partitions is granted, then the
       parameter -mbr can be used to specify an alternative MBR to be used
       (the partitioning information in the MBR file is ignored).
       The diskname is on Linux e.g. /dev/sda, and on Windows e.g.
       \\.\PhysicalDrive0).
       On Linux or FreeBSD host the parameter -relative causes a VMDK file to
       be created which refers to individual partitions instead to the entire
       disk.
       The necessary partition numbers can be queried with
         VBoxManage internalcommands listpartitions

WARNING: This is a development tool and shall only be used to analyse
         problems. It is completely unsupported and will change in
         incompatible ways without warning.

Syntax error: Invalid parameter '-register'

It worked OK without -register, though.

PS I found out this particular switch is used throughout the entire Wiki page in other recipes as well. Thaewrapt (talk) 08:56, 28 October 2019 (UTC)Reply[reply]