parent
c044375a0a
commit
6620a0f679
@ -128,10 +128,10 @@ $ nixos-rebuild build-vm
|
|||||||
$ ./result/bin/run-*-vm
|
$ ./result/bin/run-*-vm
|
||||||
</screen></para>
|
</screen></para>
|
||||||
|
|
||||||
<para>The VM is implemented using the
|
<para>The VM is implemented using the <literal>qemu</literal>
|
||||||
<literal>qemu-kvm</literal> package. For best performance, you
|
package. For best performance, you should load the
|
||||||
should load the <literal>kvm-intel</literal> or
|
<literal>kvm-intel</literal> or <literal>kvm-amd</literal>
|
||||||
<literal>kvm-amd</literal> kernel modules.</para>
|
kernel modules to get hardware virtualisation.</para>
|
||||||
|
|
||||||
<para>The VM mounts the Nix store of the host through the CIFS
|
<para>The VM mounts the Nix store of the host through the CIFS
|
||||||
filesystem. (<literal>qemu-kvm</literal> automatically starts a
|
filesystem. (<literal>qemu-kvm</literal> automatically starts a
|
||||||
|
@ -30,7 +30,7 @@ sub new {
|
|||||||
if (!$startCommand) {
|
if (!$startCommand) {
|
||||||
# !!! merge with qemu-vm.nix.
|
# !!! merge with qemu-vm.nix.
|
||||||
$startCommand =
|
$startCommand =
|
||||||
"qemu-kvm -m 384 " .
|
"$ENV{'qemu'} -enable-kvm -m 384 " .
|
||||||
"-net nic,model=virtio \$QEMU_OPTS ";
|
"-net nic,model=virtio \$QEMU_OPTS ";
|
||||||
my $iface = $args->{hdaInterface} || "virtio";
|
my $iface = $args->{hdaInterface} || "virtio";
|
||||||
$startCommand .= "-drive file=" . Cwd::abs_path($args->{hda}) . ",if=$iface,boot=on,werror=report "
|
$startCommand .= "-drive file=" . Cwd::abs_path($args->{hda}) . ",if=$iface,boot=on,werror=report "
|
||||||
|
@ -28,7 +28,8 @@ rec {
|
|||||||
|
|
||||||
wrapProgram $out/bin/nixos-test-driver \
|
wrapProgram $out/bin/nixos-test-driver \
|
||||||
--prefix PATH : "${pkgs.qemu}/bin:${pkgs.vde2}/bin:${imagemagick}/bin:${coreutils}/bin" \
|
--prefix PATH : "${pkgs.qemu}/bin:${pkgs.vde2}/bin:${imagemagick}/bin:${coreutils}/bin" \
|
||||||
--prefix PERL5LIB : "${lib.makePerlPath [ perlPackages.TermReadLineGnu perlPackages.XMLWriter perlPackages.IOTty ]}:$out/lib/perl5/site_perl"
|
--prefix PERL5LIB : "${lib.makePerlPath [ perlPackages.TermReadLineGnu perlPackages.XMLWriter perlPackages.IOTty ]}:$out/lib/perl5/site_perl" \
|
||||||
|
--set qemu qemu-system-${if pkgs.stdenv.system == "x86_64-linux" then "x86_64" else "i386"}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ let
|
|||||||
''
|
''
|
||||||
mkdir $out
|
mkdir $out
|
||||||
diskImage=$out/disk.img
|
diskImage=$out/disk.img
|
||||||
${pkgs.vmTools.kvm}/bin/qemu-img create -f qcow2 $diskImage "32M"
|
${pkgs.qemu}/bin/qemu-img create -f qcow2 $diskImage "32M"
|
||||||
'';
|
'';
|
||||||
buildInputs = [ pkgs.utillinux ];
|
buildInputs = [ pkgs.utillinux ];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user