[Nix-dev] Trouble installing NixOS on Citrix Xen

Ben Booth benwbooth at gmail.com
Wed Feb 10 18:22:37 CET 2016


Hi all,

I'm trying to install a NixOS VM onto our Citrix Xen server at work, but I'm running into several issues:

- Booting in HVM mode doesn't seem to work at all; the VM just stops on the BIOS screen

- Booting in PV mode using pygrub *almost* works, but for some reason Nix creates the /boot/grub/menu.lst file with two backslashes for each entry:

> # Automatically generated.  DO NOT EDIT THIS FILE!
> 
>         default 0
>         timeout 5
>     splashimage //background.xpm.gz
> 
> 
> title NixOS - Default
>   root (hd0)
>   kernel //kernels/78cvb2ahmvvz3fv0kilpf3pz9yfkp6hg-linux-3.18.25-bzImage systemConfig=/nix/store/m592rhpc45ap7vasl3wblgy1c90kqqx7-nixos-15.09.930.61a2952 init=//nix/store/m592rhpc45ap7vasl3wblgy1c90kqqx7-nixos-15.09.930.61a2952/init loglevel=4
>   initrd //kernels/j6wjnjrpwg4spdc0x9xw1614ki2vxgyb-initrd-initrd
> 
> 
> title NixOS - Configuration 2 (2016-02-10 - 15.09.930.61a2952)
>   root (hd0)
>   kernel //kernels/78cvb2ahmvvz3fv0kilpf3pz9yfkp6hg-linux-3.18.25-bzImage systemConfig=/nix/store/m592rhpc45ap7vasl3wblgy1c90kqqx7-nixos-15.09.930.61a2952 init=//nix/store/m592rhpc45ap7vasl3wblgy1c90kqqx7-nixos-15.09.930.61a2952/init loglevel=4
>   initrd //kernels/j6wjnjrpwg4spdc0x9xw1614ki2vxgyb-initrd-initrd
> 
> title NixOS - Configuration 1 (2016-02-08 - 15.09.930.61a2952)
>   root (hd0)
>   kernel //kernels/78cvb2ahmvvz3fv0kilpf3pz9yfkp6hg-linux-3.18.25-bzImage systemConfig=/nix/store/albjs2zqmvf3808xvjp6d0hmh6xqkw74-nixos-15.09.930.61a2952 init=//nix/store/albjs2zqmvf3808xvjp6d0hmh6xqkw74-nixos-15.09.930.61a2952/init loglevel=4
>   initrd //kernels/j6wjnjrpwg4spdc0x9xw1614ki2vxgyb-initrd-initrd


The double backslash confuses pygrub, so for now I have to manually remove the extra backslash. I'm planning on filing a bug report for this, but does anyone know a workaround in the mean time?

- The VM doesn't seem to recognize keyboard input from the XenCenter console tab, although SSH works. Is there a kernel module or initrd config I need to do to get the XenCenter console keyboard input to work?

Here is my configuration.nix in case it helps. Thanks!

> # Edit this configuration file to define what should be installed on
> # your system.  Help is available in the configuration.nix(5) man page
> # and in the NixOS manual (accessible by running ‘nixos-help’).
> 
> { config, pkgs, modulesPath, ... }:
> 
> {
>   require = [ "${modulesPath}/virtualisation/xen-domU.nix" ];
>   imports =
>     [ # Include the results of the hardware scan.
>       ./hardware-configuration.nix
>     ];
> 
>   # Use the GRUB 2 boot loader.
>   #boot.loader.grub.enable = true;
>   #boot.loader.grub.version = 2;
>   # Define on which hard drive you want to install Grub.
>   # boot.loader.grub.device = "/dev/sda";
> 
>   networking.hostName = "bbooth-nixos"; # Define your hostname.
>   networking.wireless.enable = false;  # Enables wireless support via wpa_supplicant.
> 
>   # Select internationalisation properties.
>   i18n = {
>     consoleFont = "Lat2-Terminus16";
>     consoleKeyMap = "us";
>     defaultLocale = "en_US.UTF-8";
>   };
> 
>   # Set your time zone.
>   time.timeZone = "US/Pacific";
> 
>   # List packages installed in system profile. To search by name, run:
>   # $ nix-env -qaP | grep wget
>   environment.systemPackages = with pkgs; [
>     wget
>   ];
> 
>   # List services that you want to enable:
> 
>   # Enable the OpenSSH daemon.
>   services.openssh.enable = true;
>   services.openssh.permitRootLogin = "yes";
> 
>   # Enable CUPS to print documents.
>   # services.printing.enable = true;
> 
>   # Enable the X11 windowing system.
>   # services.xserver.enable = true;
>   # services.xserver.layout = "us";
>   # services.xserver.xkbOptions = "eurosign:e";
> 
>   # Enable the KDE Desktop Environment.
>   # services.xserver.displayManager.kdm.enable = true;
>   # services.xserver.desktopManager.kde4.enable = true;
> 
>   # Define a user account. Don't forget to set a password with ‘passwd’.
>   users.extraUsers.bdgp = {
>     isNormalUser = true;
>     uid = 1000;
>     extraGroups = [ "wheel" ];
>   };
> 
>   # The NixOS release to be compatible with for stateful data such as databases.
>   system.stateVersion = "15.09";
> 
> }


More information about the nix-dev mailing list