I'm trying to follow the instructions for running LEDE in a virtual machine from the user's guide. I can get the virtual machine setup and running the combined-squashfs image but when I boot the virtual machine and try to setup the network configuration most of the subsystems seem to be missing. It's only showing three subsystems (dhcp, dropbear, and firewall). System and network don't show up so I'm not sure how to configure the system.
I"m a little rusty with VM...but did you create compatible virtual NIC cards?
Yes. I followed the instructions at...
Configured adapter 1 as a host only adapter and adapter 2 for NAT.
But...what adapter type did you use???
There are 6:
- Paravirtualized Adapter - should be in installed the Linux Kernel
- 3 Intel adapters
- 2 AMD adapters
Also, if LEDE NATs, you wouldn't need to NAT - depending on your setup.
I assume the Host-only adapter is for the LEDE LAN facing your VM Environment???
I used the "Intel Pro/1000 MT Desktop" adapter type per the instructions.
I'm new to LEDE so I'm not sure; but I made the same assumption about the purpose of the Host-only adapter.
OK, to create a virtual wired router:
- create 2 compatible adapters in the VM
- one adapter (WAN) will need to be connected to your real LAN, in order to get an IP address. You can NAT this interface if you desire.
- The other interface (LAN) would face the network you're trying to serve which I assume is a VM environment. This can be an Internal Network you setup (this is what I suggest), or Host-only.
- Instead of explaining, I think you should read about the Host-Only adapter: https://www.virtualbox.org/manual/ch06.html#network_hostonly
I think I have done that. I have two adapters configured, and when I boot the VM and do "ip a show" I can see eth0 and eth1 with the correct hardware addresses. But "uci show network" returns "uci: Entry not found" and /etc/config does not contain "system" or "network"
Correct, you NOW have to specify the interfaces in UCI.
See Steps 5-7 at: https://lede-project.org/docs/user-guide/virtualbox-vm
But I can't because the network subsystem doesn't exist. steps 4-7 just return "Entry not found" because the network subsystem isn't there. I though I might need to create it, but all the documentation says that the basic subsystems should already exist
That's because you have you CREATE IT. It seems you have not followed steps 5-7...
What commands are you using to create the configs???
Please paste them.
EDIT: LET ME BE CLEAR...BECAUSE, I'M NOT SURE IF THE STEPS ARE WORDED CORRECTLY, YOU WILL NOT SEE INTERFACES IN LEDE UNTIL YOU ADD THE CONFIGS TO UCI (but I thought that LAN was created if the interface existed at first boot).
Step 4) "let's see the current network configuration"; in the window you can see that "root@lede:~# uci show network" was entered.
I get "uci: Entry not found"
Step 5a) uci set network.lan.ipaddr='192.168.56.2'
I get "uci: Entry not found"
I assumed that the .img file loaded into the VM contained some configuration that was just being updated by the tutorial. I then set out to try and create the missing pieces listed in the tutorial.
looking at ..
Available sybsystems are: dnsmasq, dropbear, firewall, fstab, net, qos, samba, system, wireless
I don't see all of these, I only see dropbear and firewall (and DHCP, which isn't in the list).
There are instruction on using add to add sections to subsystems, but this doesn't appear to be able to create the subsections themselves.
You have to UCI SET and COMMIT before you can show...
YOU HAVE TO CONFIGURE YOUR NETWORK FIRST BEFORE YOU CAN RUN A 'SHOW' COMMAND.
You have not yet created the interfaces. You cannot SHOW until you SET and COMMIT!
I assumed that the .img linked in the tutorial had some configuration used by the tutorial already configured.
If not that's fine but I still don't see how to create the required configuration
if I try step 5a) "uci set network.lan.ipaddr='192.168.56.2'
it doesn't work because there is no "network.lan"
if I try "uci add network lan"
I get "uci: Entry not found" because there is no "network".
how do I create the network subsystem? and should it be "network" or "net" as the introduction_to_lede_configuration lists a "net" subsystem but not a "network" subsystem. or does that not matter?
not sure if it is relevant, but when I do "ip a show" I can see the two adapters created for the virtual machine, but both, as well as the loopback, all three show the state as down. Not sure if that is an indication of a problem.
I believe your first commands would be:
- uci set network lan
- uci set network lan ifname eth0
You have to create the interface before you can give it an IP address.
but how do I create "network"??
if I try "uci add network lan" I just get "uci: Entry not found" because the network subsystem doesn't exist
Did you follow these steps in the Virtualbox Settings section?
yes, the name of the network adapter is slightly different..
"VirtualBox Host-Only Ethernet Adapter" instead of "vboxnet0" but everything else lined up exactly.
As I read it, the adapter should be named vboxnet0
I assumed it was just a difference in versions of VB. There doesn't appear to be a way to change the name, when you follow the steps to create the host-only network adapter the name is created by VB.
I'm using VB 5.1.14 and the tutorial says it was tested with earlier versions