{"id":17120,"date":"2023-06-06T22:45:06","date_gmt":"2023-06-06T19:45:06","guid":{"rendered":"https:\/\/kifarunix.com\/?p=17120"},"modified":"2024-03-10T10:04:50","modified_gmt":"2024-03-10T07:04:50","slug":"install-nixos-with-gnome-desktop-on-virtualbox","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-nixos-with-gnome-desktop-on-virtualbox\/","title":{"rendered":"Install NixOS with Gnome Desktop on VirtualBox"},"content":{"rendered":"\n<p>In this tutorial, you will learn how to install NixOS with Gnome Desktop on VirtualBox.<em> NixOS, a Linux distribution based on the purely functional package management system\u00a0<a href=\"https:\/\/nixos.org\/nix\" target=\"_blank\" rel=\"noopener\">Nix<\/a>, that is composed using modules and packages defined in the\u00a0<a href=\"https:\/\/nixos.org\/nixpkgs\" target=\"_blank\" rel=\"noopener\">Nixpkgs<\/a>\u00a0project<\/em>.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#installing-nix-os-with-gnome-desktop-on-virtual-box\">Installing NixOS with Gnome Desktop on VirtualBox<\/a><ul><li><a href=\"#download-nix-os-installation-iso-file\">Download NixOS Installation ISO file<\/a><\/li><li><a href=\"#create-new-virtual-box-vm\">Create New VirtualBox VM<\/a><ul><li><a href=\"#virtual-machine-name-and-operating-system\">Virtual Machine Name and Operating System<\/a><\/li><li><a href=\"#virtual-machine-hardware\">Virtual Machine Hardware<\/a><\/li><li><a href=\"#virtual-hard-disk\">Virtual Hard Disk<\/a><\/li><li><a href=\"#enable-nix-os-processor-extended-features\">Enable NixOS Processor Extended Features<\/a><\/li><li><a href=\"#update-nix-os-graphics-controller\">Update NixOS Graphics Controller<\/a><\/li><li><a href=\"#update-vm-network-settings\">Update Vm Network Settings<\/a><\/li><\/ul><\/li><li><a href=\"#installing-nix-os-with-gnome-desktop\">Installing NixOS with Gnome Desktop<\/a><ul><li><a href=\"#start-the-nix-os-vm\">Start the NixOS VM<\/a><\/li><li><a href=\"#choose-the-installation-language\">Choose the Installation Language,<\/a><\/li><li><a href=\"#set-your-location\">Set your Location<\/a><\/li><li><a href=\"#choose-keyboard-layout\">Choose Keyboard Layout<\/a><\/li><li><a href=\"#create-user-accounts\">Create User Accounts<\/a><\/li><li><a href=\"#choose-desktop-environment\">Choose Desktop Environment<\/a><\/li><li><a href=\"#select-system-partition-scheme\">Select System Partition Scheme<\/a><\/li><li><a href=\"#install-nix-os-on-virtual-box\">Install NixOS on VirtualBox<\/a><\/li><\/ul><\/li><li><a href=\"#login-to-nix-os-with-gnome-desktop-on-virtual-box\">Login to NixOS with Gnome Desktop on VirtualBox<\/a><\/li><li><a href=\"#extras\">Extras<\/a><ul><li><a href=\"#enable-ssh-service-on-nix-os\">Enable SSH Service on NixOS<\/a><\/li><\/ul><\/li><li><a href=\"#other-tutorials\">Other Tutorials<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"installing-nix-os-with-gnome-desktop-on-virtual-box\">Installing NixOS with Gnome Desktop on VirtualBox<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"download-nix-os-installation-iso-file\">Download NixOS Installation ISO file<\/h3>\n\n\n\n<p>Navigate to <a href=\"https:\/\/nixos.org\/download.html#nixos-iso\" target=\"_blank\" rel=\"noreferrer noopener\">NixOS Downloads page<\/a> and grab ISO file.<\/p>\n\n\n\n<p>You can simply get the ISO link and pull with wget\/curl commands;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget -c https:\/\/channels.nixos.org\/nixos-23.05\/latest-nixos-gnome-x86_64-linux.iso<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-new-virtual-box-vm\">Create New VirtualBox VM<\/h3>\n\n\n\n<p>Launch VirtualBox and create a new VM.<\/p>\n\n\n\n<p>Next, step through the new vm wizard creation to create NixOS VirtualBox VM;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"virtual-machine-name-and-operating-system\">Virtual Machine Name and Operating System<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set the name of the NixOS vm.<\/li>\n\n\n\n<li>Select the VirtualBox installation folder<\/li>\n\n\n\n<li>Attach the installation ISO file you downloaded above.<\/li>\n\n\n\n<li>Select the type and version of the OS, if available.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"866\" height=\"577\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/nixos-name-and-iso.png\" alt=\"\" class=\"wp-image-17127\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/nixos-name-and-iso.png?v=1686079337 866w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/nixos-name-and-iso-768x512.png?v=1686079337 768w\" sizes=\"(max-width: 866px) 100vw, 866px\" \/><\/figure><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"virtual-machine-hardware\">Virtual Machine Hardware<\/h4>\n\n\n\n<p>Assign the VM enough RAM and vCPUs. 2GB and 2 vCPUs to start it can do.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"virtual-hard-disk\">Virtual Hard Disk<\/h4>\n\n\n\n<p>Create a virtual hard disk of the size of your choice for the NixOS with Gnome Desktop vm say 20GB.<\/p>\n\n\n\n<p>Next, review the settings of the VM and click <strong>finish<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"enable-nix-os-processor-extended-features\">Enable NixOS Processor Extended Features<\/h4>\n\n\n\n<p>To successfully boot NixOS, you need to enable Processor features.<\/p>\n\n\n\n<p>To begin with, run the command on the terminal to enable \u201cVT-x\/AMD-V\u201d acceleration.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vboxmanage modifyvm nixos2305 --nested-hw-virt on<\/code><\/pre>\n\n\n\n<p>Replace nixos2305 with the name of your NixOS.<\/p>\n\n\n\n<p>Next, from the VirtualBox manager, select the NixOS vm and open the settings and enable processor <strong><code>PAE\/NX<\/code><\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1019\" height=\"451\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/nixos-processor-extended-features.png\" alt=\"\" class=\"wp-image-17128\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/nixos-processor-extended-features.png?v=1686079399 1019w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/nixos-processor-extended-features-768x340.png?v=1686079399 768w\" sizes=\"(max-width: 1019px) 100vw, 1019px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"update-nix-os-graphics-controller\">Update NixOS Graphics Controller<\/h4>\n\n\n\n<p>Under Display, change the graphics controller to <strong>VMSVGA<\/strong>.<a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/07\/rocky-linux-9-virtualbox-2-1.png\"><\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1073\" height=\"494\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/nixos-graphics-controller.png\" alt=\"\" class=\"wp-image-17129\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/nixos-graphics-controller.png?v=1686079421 1073w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/nixos-graphics-controller-768x354.png?v=1686079421 768w\" sizes=\"(max-width: 1073px) 100vw, 1073px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"update-vm-network-settings\">Update Vm Network Settings<\/h4>\n\n\n\n<p>Under Network, you can also add other network interfaces for example;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Adapter 1 set it to NAT to allow the VM to access Internet via the host system.<\/li>\n\n\n\n<li>Adapter 2 you can set it to host only just in case you want it to communicate with other vms on your host machine and even facilitate easy access from the host system.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1122\" height=\"522\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/05\/network-settings.png\" alt=\"\" class=\"wp-image-16849\" title=\"Install NixOS with Gnome Desktop on VirtualBox 3\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/05\/network-settings.png?v=1685444064 1122w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/05\/network-settings-768x357.png?v=1685444064 768w\" sizes=\"(max-width: 1122px) 100vw, 1122px\" \/><\/figure>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/07\/rocky-linux-9-virtualbox-3.png\"><\/a><\/p>\n\n\n\n<p>Click&nbsp;<strong>Ok<\/strong>&nbsp;when done updating the NixOS vm settings.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installing-nix-os-with-gnome-desktop\">Installing NixOS with Gnome Desktop<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"start-the-nix-os-vm\">Start the NixOS VM<\/h4>\n\n\n\n<p>Once you have setup your VM and attached the ISO file, and done updating other settings, click the start button to power on the vm and begin the installation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"870\" height=\"640\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/install-nixos.png\" alt=\"\" class=\"wp-image-17130\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/install-nixos.png?v=1686079493 870w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/install-nixos-768x565.png?v=1686079493 768w\" sizes=\"(max-width: 870px) 100vw, 870px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"choose-the-installation-language\">Choose the Installation Language,<\/h4>\n\n\n\n<p>Choose your installation language.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"set-your-location\">Set your Location<\/h4>\n\n\n\n<p>Select your location.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"choose-keyboard-layout\">Choose Keyboard Layout<\/h4>\n\n\n\n<p>Select your appropriate keyboard.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"create-user-accounts\">Create User Accounts<\/h4>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"838\" height=\"643\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/create-user-accounts.png\" alt=\"\" class=\"wp-image-17131\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/create-user-accounts.png?v=1686079530 838w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/create-user-accounts-768x589.png?v=1686079530 768w\" sizes=\"(max-width: 838px) 100vw, 838px\" \/><\/figure>\n\n\n\n<p>You can choose to set a different administrator password or use the same as the one for the user created.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"choose-desktop-environment\">Choose Desktop Environment<\/h4>\n\n\n\n<p>We choose GNOME. You can choose whichever you want.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"824\" height=\"623\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/choose-desktop-environment.png\" alt=\"\" class=\"wp-image-17132\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/choose-desktop-environment.png?v=1686079556 824w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/choose-desktop-environment-768x581.png?v=1686079556 768w\" sizes=\"(max-width: 824px) 100vw, 824px\" \/><\/figure>\n\n\n\n<p>We skip unfree software option.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"select-system-partition-scheme\">Select System Partition Scheme<\/h4>\n\n\n\n<p>Select how you want to partition the disk.<\/p>\n\n\n\n<p>Next, go through the installation summary.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"install-nix-os-on-virtual-box\">Install NixOS on VirtualBox<\/h4>\n\n\n\n<p>Click <strong>Install<\/strong> to install NixOS;<\/p>\n\n\n\n<div class=\"wp-block-cover is-light\"><span aria-hidden=\"true\" class=\"wp-block-cover__background has-background-dim\"><\/span><img loading=\"lazy\" decoding=\"async\" width=\"830\" height=\"630\" class=\"wp-block-cover__image-background wp-image-17133\" alt=\"Install NixOS with Gnome Desktop on VirtualBox\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/install-nixos-virtualbox.png\" data-object-fit=\"cover\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/install-nixos-virtualbox.png?v=1686079589 830w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/install-nixos-virtualbox-768x583.png?v=1686079589 768w\" sizes=\"(max-width: 830px) 100vw, 830px\" \/><div class=\"wp-block-cover__inner-container is-layout-flow wp-block-cover-is-layout-flow\">\n<p class=\"has-text-align-center has-large-font-size\"><\/p>\n<\/div><\/div>\n\n\n\n<p>When it is all done, shutdown the VM and be sure to detach installation ISO file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"login-to-nix-os-with-gnome-desktop-on-virtual-box\">Login to NixOS with Gnome Desktop on VirtualBox<\/h3>\n\n\n\n<p>Start your NixOS VM on virtualbox after detaching the installation ISO file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1057\" height=\"799\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/start-nixos-on-virtualbox.png\" alt=\"\" class=\"wp-image-17134\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/start-nixos-on-virtualbox.png?v=1686079877 1057w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/start-nixos-on-virtualbox-768x581.png?v=1686079877 768w\" sizes=\"(max-width: 1057px) 100vw, 1057px\" \/><\/figure>\n\n\n\n<p>When it is booted completely, login to your NixOS with Gnome Desktop;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"825\" height=\"632\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/nixos-on-virtualbox.png\" alt=\"\" class=\"wp-image-17135\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/nixos-on-virtualbox.png?v=1686080003 825w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/nixos-on-virtualbox-768x588.png?v=1686080003 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/figure>\n\n\n\n<p>That is all about how to install NixOS with Gnome Desktop on VirtualBox.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"extras\">Extras<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"enable-ssh-service-on-nix-os\">Enable SSH Service on NixOS<\/h4>\n\n\n\n<p>You can check if SSH port is opened once you login to your NixOS vm;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -altnp | grep :22<\/code><\/pre>\n\n\n\n<p>If no output, then chances are SSH is not enabled.<\/p>\n\n\n\n<p>Check if SSH daemon is enabled;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep ssh \/etc\/nixos\/configurations.nix<\/code><\/pre>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># services.openssh.enable = true;<\/code><\/pre>\n\n\n\n<p>As you can see, it is disabled.<\/p>\n\n\n\n<p>So, to enable SSH service on NixOS, edit the <strong><code>\/etc\/nixos\/configurations.nix<\/code><\/strong> configuration file;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sed -i '\/openssh\/s\/#\/\/' \/etc\/nixos\/configurations.nix<\/code><\/pre>\n\n\n\n<p>Confirm the enablement;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep ssh \/etc\/nixos\/configurations.nix<\/code><\/pre>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services.openssh.enable = true;<\/code><\/pre>\n\n\n\n<p>Apply the changes;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nixos-rebuild switch<\/code><\/pre>\n\n\n\n<p>Once the changes are applied, SSH service should now be running.<\/p>\n\n\n\n<p>Check status;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status sshd<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"other-tutorials\">Other Tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/easily-install-solaris-11-4-on-virtualbox\/\" target=\"_blank\" rel=\"noreferrer noopener\">Easily Install Solaris 11.4 on VirtualBox<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-fix-qemu-kvm-not-connected-error-on-ubuntu-20-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to fix QEMU\/KVM Not Connected Error on Ubuntu 20.04<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to install NixOS with Gnome Desktop on VirtualBox. NixOS, a Linux distribution based on the purely functional package<\/p>\n","protected":false},"author":10,"featured_media":17137,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,46,36],"tags":[6850,6849,6846,6847,6851,6852,6848],"class_list":["post-17120","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-virtualbox","category-virtualization","tag-enable-ssh-on-nixos","tag-how-to-install-nixos","tag-install-nixos-on-virtualbox","tag-installing-nixos-os","tag-nixos-enable-ssh-daemon","tag-nixos-ssh","tag-virtualbox-nixos","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/17120"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=17120"}],"version-history":[{"count":9,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/17120\/revisions"}],"predecessor-version":[{"id":20792,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/17120\/revisions\/20792"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/17137"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=17120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=17120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=17120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}