1# Installing in a VirtualBox guest {#sec-installing-virtualbox-guest}
2
3Installing NixOS into a VirtualBox guest is convenient for users who
4want to try NixOS without installing it on bare metal. If you want to
5use a pre-made VirtualBox appliance, it is available at [the downloads
6page](https://nixos.org/download/#nixos-virtualbox). If you want to set
7up a VirtualBox guest manually, follow these instructions:
8
91. Add a New Machine in VirtualBox with OS Type "Linux / Other Linux"
10
111. Base Memory Size: 768 MB or higher.
12
131. New Hard Disk of 8 GB or higher.
14
151. Mount the CD-ROM with the NixOS ISO (by clicking on CD/DVD-ROM)
16
171. Click on Settings / System / Processor and enable PAE/NX
18
191. Click on Settings / System / Acceleration and enable "VT-x/AMD-V"
20 acceleration
21
221. Click on Settings / Display / Screen and select VMSVGA as Graphics
23 Controller
24
251. Save the settings, start the virtual machine, and continue
26 installation like normal
27
28There are a few modifications you should make in configuration.nix.
29Enable booting:
30
31```nix
32{
33 boot.loader.grub.device = "/dev/sda";
34}
35```
36
37Also remove the fsck that runs at startup. It will always fail to run,
38stopping your boot until you press `*`.
39
40```nix
41{
42 boot.initrd.checkJournalingFS = false;
43}
44```
45
46Shared folders can be given a name and a path in the host system in the
47VirtualBox settings (Machine / Settings / Shared Folders, then click on
48the "Add" icon). Add the following to the
49`/etc/nixos/configuration.nix` to auto-mount them. If you do not add
50`"nofail"`, the system will not boot properly.
51
52```nix
53{ config, pkgs, ...} :
54{
55 fileSystems."/virtualboxshare" = {
56 fsType = "vboxsf";
57 device = "nameofthesharedfolder";
58 options = [ "rw" "nofail" ];
59 };
60}
61```
62
63The folder will be available directly under the root directory.