-
Notifications
You must be signed in to change notification settings - Fork 10
/
shell.nix
36 lines (32 loc) · 1.24 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ pkgs ? import <nixpkgs> { } }:
let
vmrunner = pkgs.callPackage ./default.nix { };
in
pkgs.mkShell rec {
buildInputs = [
pkgs.qemu
];
packages = [
vmrunner
];
# This binary must be added to the sudoers list to enable bridged networking
qemu_bridge_helper = "${pkgs.qemu}/libexec/qemu-bridge-helper";
# In addition, you'll need /etc/qemu/bridge.conf to contain this line:
# allow bridge43
# This bridge can be set up with /bin/create_bridge.sh
create_bridge = vmrunner.create_bridge;
shellHook = ''
echo ""
echo "================= vmrunner example shell ================="
echo "The vmrunner for IncludeOS tests requires bridged networking for full functionality."
echo "In order to use bridge networking, you need the following:"
echo "1. the qemu-bridge-helper needs sudo. Can be enabled with:"
echo " sudo chmod u+s ${qemu_bridge_helper}"
echo "2. bridge43 must exist. Can be set up with \$create_bridge :"
echo " ${vmrunner.create_bridge}"
echo "3. /etc/qemu/bridge.conf must contain this line:"
echo " allow bridge43"
echo "These steps require sudo. Without them we're restricted to usermode networking."
echo
'';
}