Comments (3)
The patch was applied to master in ce3bbd0 and c20ddde
from nixos-shell.
what about the multihoming issue ? it seems to work fine with the nixos/tests infrastructure. There seems to be some related code (to vlans) in nixos/lib/testing.nix but it doesn't seem called in nixos-shell
from nixos-shell.
I managed to come up in my vm.nix with sthg like
let
vlans = [ 1 2];
zeroPad = n: if n < 10 then "0${toString n}" else toString n;
# see https://wiki.qemu.org/Documentation/Networking 's doc
qemuNICFlags = nic: net: machine:
[ "-device virtio-net-pci,netdev=vlan${toString nic},mac=52:54:00:12:${zeroPad net}:${zeroPad machine}"
"-netdev user,id=vlan${toString nic}"
];
in
{
virtualisation.qemu.options = with pkgs.lib; let
m = {snd = 1;};
interfacesNumbered = zipLists vlans (range 1 255);
interfaces = flip map interfacesNumbered ({ fst, snd }:
nameValuePair "eth${toString snd}" { ipv4.addresses =
[ { address = "192.168.${toString fst}.${toString m.snd}";
prefixLength = 24;
} ];
});
in
flip map interfacesNumbered
({ fst, snd }: qemuNICFlags snd fst m.snd);
}
actually the doc of virtualisation.qemu.vlans is a bit misleading as it will work only with extra code (as in nixos tests). Also I wanted to run my own kernel but qemu-vm hardcodes it. Hopefully qemu uses the last parameter set on the command line so I can still override the nixpkgs one.
I might have a look at improving qemu-vm.nix. The pasted code uses SLIRP which seems to be bad for perf. maybe nixos-shell could run some VDE logic as the nixos tests. Anyway that should be good for now on my side.
from nixos-shell.
Related Issues (20)
- Flake support HOT 2
- Error after logging in with fish shell HOT 1
- Error: Option virtualisation.memorySize is not of type positive integer HOT 1
- Force VM rebuild HOT 3
- Add option to create guest home directory HOT 1
- Example vm script does not work HOT 2
- Cannot override default net device HOT 3
- virtualisation.msize error HOT 9
- Run one-off command
- How to use nixos-shell modules from a flake.nix file HOT 2
- Easiest way to make an ephemeral VM (reboot to restore)? HOT 3
- Any chance to get the latest version added to nixpkgs? HOT 1
- Failing with current unstable HOT 3
- vm_forward.nix example passes net option twice HOT 1
- Graphical log-in not working HOT 2
- Can't access custom nixos configuration attr
- Odd file permissions? HOT 1
- jq impurity in flake mode
- unset `NIX_PATH` causes nixos-shell to not work
- The option virtualisation.* does not exist HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nixos-shell.