To make a Xen VM accessing Internet:
brctl addif xenbr0 eth0
iptables -A FORWARD -o wlp2s0 -i xenbr0 -s 10.0.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o wlp2s0 -j MASQUERADE
iptables -t nat -A POSTROUTING -j MASQUERADE (routage)
echo 1 > /proc/sys/net/ipv4/ip_forward
/etc/init.d/procps restart
echo "nameserver 8.8.8.8" > /etc/resolv.conf
route add default gw addr_xenbr0_dans_lhote
apt install nfs-kernel-server
Add in the /etc/exports file the following line:
/paht/to/the/file/to/share *(rw,sync,no_root_squash)// * means share with all users
If you modify the exports file, you must reload the server as follows: sudo service nfs-kernel-server reload
apt install nfs-common
mount -t nfs server_addr:/path/to/the/shared/file/in/the/server /path/in/the/client
CPU distribution per VM: xl vcpu-list
Assign specific physical CPU to vCPU of VMs: xl vcpu-pin id_vm vcpu pcpu
Launch a program by assigning specific CPU: taskset -c num_cpu app
Assign CPU to a running process: taskset -p mask pid
In the tools/ dir: problems with memfd and asprintf
-#ifdef CONFIG_MEMFD
-#include <sys/memfd.h>
-#elif defined CONFIG_LINUX
+#if defined CONFIG_LINUX && !defined CONFIG_MEMFD
-#include <sys/memfd.h>
+#include <sys/mman.h>
* In the function "int main", declare a variable return_asprintf = 0 (line 446)
* Everywhere asprintf is called (lines 485 & 489), assign it to that variable like this: return_asprintf = asprintf(&path, "%s/%u", TEST_PATH, getpid());
sudo blkid //to see where each partition is mounted (in my case /dev/nvme0n1p1)
sudo mkdir tmp && sudo mount /dev/nvme0n1p1 tmp/
cd tmp
vim EFI/ubuntu/grub.cfg //in this file change the UUID of the OS you want to use the grub
You have to patch /etc/grub.d/20_linux_xen
Download the patch: 20_linux_xen.patch
Then copy it to /etc/: cp 20_linux_xen.patch /etc/grub.d/
Move to the grub.d dir and finally apply the patch:
cd /etc/grub.d
patch -c -i 20_linux_xen.patch
Create a wifi-resume service: sudo nano /etc/systemd/system/wifi-resume.service
Copy this to wifi-resume.service file:
[Unit]
Description=Local system resume actions
After=suspend.target
[Service]
Type=oneshot
ExecStart=/bin/systemctl restart network-manager.service
[Install]
WantedBy=suspend.targ
Change execution mode of the file: sudo chmod +x /etc/systemd/system/wifi-resume.service
Update the systemctl to consider the new service: sudo systemctl enable wifi-resume.service
Reboot: reboot
Add this to /boot/grub/meu.list:
//before the list of entries
serial --unit=0 --speed=9600
terminal --timeout=5 serial console
//at the end of the corresponding entry (the one you boot on)
console=ttyS0
cd /path/to/linux-4.15-rc7
apt install libdw-dev libaudit-dev libslang2-dev liblzma-dev libunwind-dev binutils-dev libnuma-dev systemtap-sdt-dev zlib1g-dev libiberty-dev
make -C tools/ perf_install prefix=/usr/
perf help
In virtualized environments, you must enable the virtualization of HW PMC (Performance Monitoring Counters)
With Xen, set vpmu to on in the grub.cfg file
/boot/xen.gz placeholder ${xen_rm_opts} loglvl=all guest_loglvl=all vpmu=on
sudo losetup -o $offset /dev/loopX image.raw
sudo mount /dev/loopX mount_point/
To find the offset: sudo fdisk/parted image.raw
First, make sure to add your fields at the right position inside the structure; otherwise, you may encounter unexplained memory segfault because the OS automatically aligned some specific structures that are sensitive.
It seems a better practice to add rather a structure than an elementary type like an unsigned long.
If you look at the Linux 4.15 source code, you will find explicit alignment delimitation inside the structure. Given this, we think it is better to add a new field just before #ifdef CONFIG_MEMCG
Finally, you should:
* either bypass the control check of Linux on the struct page's size (in drivers/nvdimm/pfn_devs.c), comment this line as follows: //BUILD_BUG_ON(sizeof(struct page) > MAX_STRUCT_PAGE_SIZE);
* or increase the MAX_STRUCT_PAGE_SIZE