1<section xmlns="http://docbook.org/ns/docbook"
2 xmlns:xlink="http://www.w3.org/1999/xlink"
3 xmlns:xi="http://www.w3.org/2001/XInclude"
4 version="5.0"
5 xml:id="sec-instaling-virtualbox-guest">
6
7<title>Installing in a Virtualbox guest</title>
8<para>
9 Installing NixOS into a Virtualbox guest is convenient for users who want to
10 try NixOS without installing it on bare metal. If you want to use a pre-made
11 Virtualbox appliance, it is available at <link
12 xlink:href="https://nixos.org/nixos/download.html">the downloads page</link>.
13 If you want to set up a Virtualbox guest manually, follow these instructions:
14</para>
15
16<orderedlist>
17
18 <listitem><para>Add a New Machine in Virtualbox with OS Type "Linux / Other
19 Linux"</para></listitem>
20
21 <listitem><para>Base Memory Size: 768 MB or higher.</para></listitem>
22
23 <listitem><para>New Hard Disk of 8 GB or higher.</para></listitem>
24
25 <listitem><para>Mount the CD-ROM with the NixOS ISO (by clicking on
26 CD/DVD-ROM)</para></listitem>
27
28 <listitem><para>Click on Settings / System / Processor and enable
29 PAE/NX</para></listitem>
30
31 <listitem><para>Click on Settings / System / Acceleration and enable
32 "VT-x/AMD-V" acceleration</para></listitem>
33
34 <listitem><para>Save the settings, start the virtual machine, and continue
35 installation like normal</para></listitem>
36
37</orderedlist>
38
39<para>
40 There are a few modifications you should make in configuration.nix.
41 Enable booting:
42</para>
43
44<programlisting>
45boot.loader.grub.device = "/dev/sda";
46</programlisting>
47
48<para>
49 Also remove the fsck that runs at startup. It will always fail to run,
50 stopping your boot until you press <literal>*</literal>.
51</para>
52
53<programlisting>
54boot.initrd.checkJournalingFS = false;
55</programlisting>
56
57<para>
58 Shared folders can be given a name and a path in the host system in the
59 VirtualBox settings (Machine / Settings / Shared Folders, then click on the
60 "Add" icon). Add the following to the
61 <literal>/etc/nixos/configuration.nix</literal> to auto-mount them:
62</para>
63
64<programlisting>
65{ config, pkgs, ...} :
66{
67 ...
68
69 fileSystems."/virtualboxshare" = {
70 fsType = "vboxsf";
71 device = "nameofthesharedfolder";
72 options = [ "rw" ];
73 };
74}
75</programlisting>
76
77<para>
78 The folder will be available directly under the root directory.
79</para>
80
81</section>