[Nix-dev] NixOS inside a 64-bit Xen Guest (x86_64)

Nicolas Pierron nicolas.b.pierron at gmail.com
Thu Jan 1 11:14:31 CET 2009


Hi Jim,

On Thu, Jan 1, 2009 at 00:58, Jim Pick <jim at jimpick.com> wrote:
> I've managed to hack up NixOS enough that I can run it inside a 64-bit Xen
> session (as a guest).
>
> I don't have any installable images yet, but I have my modifications stored
> in git, so I decided it would be worthwhile to share them.

Thanks.

>  http://github.com/jpick/nixos-xen64-nixos/tree/master

I have some remarks on your commits:

commit  317a2b236926e888cb81932a6528c45c8fb1bdc8:

You should not modify system/options.nix, instead you should put
inside your /etc/nixos/configuration.nix file the following lines:

{
  boot = {
    kernelParams = [ "selinux=0" ];
  };
}

This configuration defines the default, which is currently the default
use case in order to avoid pasting these lines into each user
configuration. (even me)

commit  5aa4ab9f75fa002a58eefa672f02dd792c5277e6:

The root you have specified is hard coded and this may not be the same
configuration for everybody.

commit  95aa5ac0d2d54477f0ff0146cd26c1e582197992:
commit  2109cb0c03ce8f050e1d10b80b85c9ae4b40c263:

Ok, your problem here (I am guessing) is that you have a bad name for
you tty.  Wouldn't it be easier to just create a static link to the
tty* at the boot stage ?

for i in /dev/tty*; do
  ln $i ${i/tty/hvc};
done

commit  42ce4cb8de8632afc810f9d0dfcca15535ee5706:

As well as the first comment, you should not modify system/option.nix,
instead you should put inside your /etc/nixos/configuration.nix file
the following lines:

{
  services = {
    mingetty = {
      ttys = [0];
    };
  };
}

>  http://github.com/jpick/nixos-xen64-nixpkgs/tree/master

The kernel configuration is made to be portable, so as you have
remarked, this is not a good choice to have a minimal kernel
configuration.  There is an option which can be defined which is
called "kernelPackages" and which takes your kernel installation in
which you can specify your system configuration.

> I bootstraped it by first installing NixOS inside VirtualBox on my Mac
> (which now supports 64-bit), then I tarred it up, and manually created an
> image on my server.  I had to manually modify the initrd so I could get it
> to work with a kernel I already had.  Then I figured out how to build a
> kernel with NixOS with a configuration that worked.  I had to make some
> modifications to the startup scripts as well (eg. different device names).
>
> It would be nice to get the modifications cleanly merged upstream.  The
> hacks I currently have are more of the 'brute force' variety.

I think you should try to do the same configuration of NixOS without
making any modifications inside nixos and nixpkgs repositories (except
for the device name modification).  The other modifications you have
made are good for your system but may not be good for others.

Feel free to ask if you have any questions.

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron
- If you are doing something twice then you should try to do it once.



More information about the nix-dev mailing list