Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment > Execute not working in Ubuntu 20.04.5 LTS (WSL 2) #111

Open
james1236 opened this issue Feb 28, 2023 · 7 comments
Open

Experiment > Execute not working in Ubuntu 20.04.5 LTS (WSL 2) #111

james1236 opened this issue Feb 28, 2023 · 7 comments

Comments

@james1236
Copy link

When doing Experiment > Execute, I get the error popup:

Error: Specified qdisc kind is unknown.
Error: Specified qdisc kind is unknown.
    while executing
"exec nsenter -n -t 6680 tc qdisc add dev eth0 root netem"
    ("eval" body line 1)
    invoked from within
"eval exec $cmd [getNetemConfigLine $bandwidth $delay $loss $dup]"
    (procedure "configureIfcLinkParams" line 47)
    invoked from within
"configureIfcLinkParams $eid $lnode1 $ifname1 $bandwidth $delay $ber $dup"
    (procedure "execSetLinkParams" line 27)
    invoked from within
"execSetLinkParams $eid $link"
    (procedure "configureLinkBetween" line 5)
    invoked from within
"configureLinkBetween $lnode1 $lnode2 $ifname1 $ifname2 $link"
    (procedure "deployCfg" line 132)
    invoked from within
"deployCfg"
    (procedure "setOperMode" line 74)
    invoked from within
"setOperMode exec"
    invoked from within
".#menubar.#menubar#experiment invoke active"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list $w invoke active]"
    (procedure "tk::MenuInvoke" line 50)
    invoked from within
"tk::MenuInvoke .#menubar.#menubar#experiment 1"
    (command bound to event)

To run IMUNES I do

sudo dockerd
sudo ovs-vswitchd
sudo /etc/init.d/openvswitch-switch start

I am running Ubuntu 20.04.5 LTS in windows subsystem linux 2

My versions are

$ docker --version
Docker version 23.0.1, build a5ee5b1

$ sudo ovs-vswitchd --version
ovs-vswitchd (Open vSwitch) 2.13.8

$ sudo imunes --version
IMUNES v2.3.0 (git: 9bff93c)
Last changed: 2022-09-15 13:39:12 +0200

I believe this may be related, but I don't understand any of it:
microsoft/WSL#8584

@james1236 james1236 changed the title Simulation not working in Ubuntu 20.04.5 LTS (WSL 2) Experiment > Execute not working in Ubuntu 20.04.5 LTS (WSL 2) Feb 28, 2023
@dudeisbrendan03
Copy link

You need to enable NETEM features in your WSL kernel, it is not enabled by default.

# Clone
git clone https://github.com/microsoft/WSL2-Linux-Kernel.git

# Dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential flex bison libgtk2.0-dev libelf-dev libncurses-dev autoconf libudev-dev libtool zip unzip v4l-utils libssl-dev python3-pip cmake git iputils-ping net-tools

# Configure
cd WSL2-Linux-Kernel
sudo cp /proc/config.gz config
sudo mv config .config
sudo make menuconfig
# Inside the menuconfig screen, head to Networking Support -> Networking Options -> QoS/Fair options -> NETEM


# Prepare Kernel
sudo make -j$(nproc)
sudo make modules_install -j$(nproc)
sudo make install -j$(nproc)
sudo cp vmlinux /mnt/c

You may need other QoS features enabled, I am unsure and have not tested it myself yet.

Once you've copied your compiled kernel to disk, you will have to update your WSL2 config (C:\Users\MyUser.wslconfig), if you do not have a config create one, you just need to tell WSL2 to load a different kernel! :)

[wsl2]
kernel=C:\\vmlinux

Once that's done, use wsl --shutdown MyWSLInstance to shutdown your WSL2 machine completely, next time it boots (hopefully) you should have your freshly compiled kernel loaded with the features you need!

I'm having to install this into WSL2 soon and I'll let you know how it goes.

This is no guarantee, and keep in mind that this could be destructive.

@shimachao
Copy link

You need to enable NETEM features in your WSL kernel, it is not enabled by default.

# Clone
git clone https://github.com/microsoft/WSL2-Linux-Kernel.git

# Dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential flex bison libgtk2.0-dev libelf-dev libncurses-dev autoconf libudev-dev libtool zip unzip v4l-utils libssl-dev python3-pip cmake git iputils-ping net-tools

# Configure
cd WSL2-Linux-Kernel
sudo cp /proc/config.gz config
sudo mv config .config
sudo make menuconfig
# Inside the menuconfig screen, head to Networking Support -> Networking Options -> QoS/Fair options -> NETEM


# Prepare Kernel
sudo make -j$(nproc)
sudo make modules_install -j$(nproc)
sudo make install -j$(nproc)
sudo cp vmlinux /mnt/c

You may need other QoS features enabled, I am unsure and have not tested it myself yet.

Once you've copied your compiled kernel to disk, you will have to update your WSL2 config (C:\Users\MyUser.wslconfig), if you do not have a config create one, you just need to tell WSL2 to load a different kernel! :)

[wsl2]
kernel=C:\\vmlinux

Once that's done, use wsl --shutdown MyWSLInstance to shutdown your WSL2 machine completely, next time it boots (hopefully) you should have your freshly compiled kernel loaded with the features you need!

I'm having to install this into WSL2 soon and I'll let you know how it goes.

This is no guarantee, and keep in mind that this could be destructive.

I tried this method many times, but it didn't work

@denisSal
Copy link
Member

You need to enable NETEM features in your WSL kernel, it is not enabled by default.
...

I tried this method many times, but it didn't work

For anyone else with this problem, I have also tried this (with similar steps), and successfully installed the NETEM module:

# Clone
git clone https://github.com/microsoft/WSL2-Linux-Kernel.git

# Dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential flex bison libgtk2.0-dev libelf-dev \
    libncurses-dev autoconf libudev-dev libtool zip unzip v4l-utils libssl-dev \
    python3-pip cmake git iputils-ping net-tools dwarves

# Configure
cd WSL2-Linux-Kernel
sudo cp Microsoft/config-wsl .config
sudo make menuconfig
# Inside the menuconfig screen, head to:
# Networking Support -> Networking Options -> QoS/Fair options -> NETEM
# and mark it as * (spacebar two times, if I remember correctly)

# Prepare Kernel
sudo make -j$(nproc)
sudo make headers_install -j$(nproc)
sudo make modules_install -j$(nproc)
sudo make install -j$(nproc)
sudo cp vmlinux /mnt/c

From Windows, I then created the file C:\Users\<username>\.wslconfig with the contents of:

[wsl2]
kernel=C:\\vmlinux

Then cmd:

> wsl --shutdown
> wsl

And sudo tc qdisc add dev eth0 root netem inside WSL now does not return any errors, so IMUNES experiment works.

@djturizo
Copy link

You need to enable NETEM features in your WSL kernel, it is not enabled by default.
...

I tried this method many times, but it didn't work

For anyone else with this problem, I have also tried this (with similar steps), and successfully installed the NETEM module:

# Clone
git clone https://github.com/microsoft/WSL2-Linux-Kernel.git

# Dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential flex bison libgtk2.0-dev libelf-dev \
    libncurses-dev autoconf libudev-dev libtool zip unzip v4l-utils libssl-dev \
    python3-pip cmake git iputils-ping net-tools dwarves

# Configure
cd WSL2-Linux-Kernel
sudo cp Microsoft/config-wsl .config
sudo make menuconfig
# Inside the menuconfig screen, head to:
# Networking Support -> Networking Options -> QoS/Fair options -> NETEM
# and mark it as * (spacebar two times, if I remember correctly)

# Prepare Kernel
sudo make -j$(nproc)
sudo make headers_install -j$(nproc)
sudo make modules_install -j$(nproc)
sudo make install -j$(nproc)
sudo cp vmlinux /mnt/c

From Windows, I then created the file C:\Users\<username>\.wslconfig with the contents of:

[wsl2]
kernel=C:\\vmlinux

Then cmd:

> wsl --shutdown
> wsl

And sudo tc qdisc add dev eth0 root netem inside WSL now does not return any errors, so IMUNES experiment works.

Thank you so much, after compiling the linux kernel dozens of times this is the one solution that worked for me.

@mgramagl
Copy link

mgramagl commented May 5, 2024

You need to enable NETEM features in your WSL kernel, it is not enabled by default.
...

I tried this method many times, but it didn't work

For anyone else with this problem, I have also tried this (with similar steps), and successfully installed the NETEM module:

# Clone
git clone https://github.com/microsoft/WSL2-Linux-Kernel.git

# Dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential flex bison libgtk2.0-dev libelf-dev \
    libncurses-dev autoconf libudev-dev libtool zip unzip v4l-utils libssl-dev \
    python3-pip cmake git iputils-ping net-tools dwarves

# Configure
cd WSL2-Linux-Kernel
sudo cp Microsoft/config-wsl .config
sudo make menuconfig
# Inside the menuconfig screen, head to:
# Networking Support -> Networking Options -> QoS/Fair options -> NETEM
# and mark it as * (spacebar two times, if I remember correctly)

# Prepare Kernel
sudo make -j$(nproc)
sudo make headers_install -j$(nproc)
sudo make modules_install -j$(nproc)
sudo make install -j$(nproc)
sudo cp vmlinux /mnt/c

From Windows, I then created the file C:\Users\<username>\.wslconfig with the contents of:

[wsl2]
kernel=C:\\vmlinux

Then cmd:

> wsl --shutdown
> wsl

And sudo tc qdisc add dev eth0 root netem inside WSL now does not return any errors, so IMUNES experiment works.

I can successfully run an experiment on WSL2 using these steps, but switches are not listed using ovs-vsctl

@denisSal
Copy link
Member

You need to enable NETEM features in your WSL kernel, it is not enabled by default.
...

I tried this method many times, but it didn't work

For anyone else with this problem, I have also tried this (with similar steps), and successfully installed the NETEM module:

# Clone
git clone https://github.com/microsoft/WSL2-Linux-Kernel.git

# Dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential flex bison libgtk2.0-dev libelf-dev \
    libncurses-dev autoconf libudev-dev libtool zip unzip v4l-utils libssl-dev \
    python3-pip cmake git iputils-ping net-tools dwarves

# Configure
cd WSL2-Linux-Kernel
sudo cp Microsoft/config-wsl .config
sudo make menuconfig
# Inside the menuconfig screen, head to:
# Networking Support -> Networking Options -> QoS/Fair options -> NETEM
# and mark it as * (spacebar two times, if I remember correctly)

# Prepare Kernel
sudo make -j$(nproc)
sudo make headers_install -j$(nproc)
sudo make modules_install -j$(nproc)
sudo make install -j$(nproc)
sudo cp vmlinux /mnt/c

From Windows, I then created the file C:\Users\<username>\.wslconfig with the contents of:

[wsl2]
kernel=C:\\vmlinux

Then cmd:

> wsl --shutdown
> wsl

And sudo tc qdisc add dev eth0 root netem inside WSL now does not return any errors, so IMUNES experiment works.

I can successfully run an experiment on WSL2 using these steps, but switches are not listed using ovs-vsctl

Hi, glad to hear that the experiment now runs!

IMUNES does not use Open vSwitch since version 2.4.0. Can I ask you, why exactly do you need those switches?

Denis

@mgramagl
Copy link

mgramagl commented May 12, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants