From a6e3ac3bf259067ffd6e50fe8e4a158f097c1da5 Mon Sep 17 00:00:00 2001 From: Radoslav Gerganov Date: Wed, 14 Oct 2020 16:46:20 +0300 Subject: vm/vmware: improve kernel log collection and VM management * Collecting kernel logs with dmesg over ssh doesn't work well and sometimes we miss call traces when a crash occurs. Getting the kernel log from a virtual serial port is much more effective. * Creating linked clone VMs is faster then full clone VMs but it requires snapshot management and this will bring more complexity to syzkaller. Keep it simple and create full clone VMs for now. * Use host-only networking because the VM gets its IP faster that way --- docs/linux/setup_ubuntu-host_vmware-vm_x86-64-kernel.md | 12 ++++++++++-- docs/linux/vmw-settings.png | Bin 0 -> 87824 bytes 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 docs/linux/vmw-settings.png (limited to 'docs/linux') diff --git a/docs/linux/setup_ubuntu-host_vmware-vm_x86-64-kernel.md b/docs/linux/setup_ubuntu-host_vmware-vm_x86-64-kernel.md index 3ac29c0c0..f1f7d8db8 100644 --- a/docs/linux/setup_ubuntu-host_vmware-vm_x86-64-kernel.md +++ b/docs/linux/setup_ubuntu-host_vmware-vm_x86-64-kernel.md @@ -46,11 +46,14 @@ Assuming you want to create the new VM in `$VMPATH`, complete the wizard as foll * Guest OS type: Linux * Virtual Machine Name and Location: select `$VMPATH` as location and "debian" as name * Processors and Memory: select as appropriate -* Network connection: NAT +* Network connection: Use host-only networking * I/O Controller Type: LSI Logic * Virtual Disk Type: IDE * Disk: select "Use an existing virtual disk" * Existing Disk File: enter the path of `disk.vmdk` created above +* Select "Cusomize Hardware..." and remove the "Printer" device if you have one. Add a new "Serial Port" device. For the serial port connection choose "Use socket (named pipe)" and enter "serial" for the socket path. At the end it should look like this: + +![Virtual Machine Settings](vmw-settings.png?raw=true) When you complete the wizard, you should have `$VMPATH/debian.vmx`. From this point onward, you no longer need the Workstation UI. @@ -69,6 +72,11 @@ SSH into the VM: ssh -i key root@ ``` +Connecting to the serial port of the VM (after it is started): +``` bash +nc -U $VMPATH/serial +``` + Stopping the VM: ``` bash vmrun stop $VMPATH/debian.vmx @@ -104,7 +112,7 @@ mkdir workdir ./bin/syz-manager -config=my.cfg ``` -Syzkaller will create linked clone VMs from the `base_vmx` VM and then use ssh to copy and execute programs in them. +Syzkaller will create full clone VMs from the `base_vmx` VM and then use ssh to copy and execute programs in them. The `base_vmx` VM will not be started and its disk will remain unmodified. If you get issues after `syz-manager` starts, consider running it with the `-debug` flag. diff --git a/docs/linux/vmw-settings.png b/docs/linux/vmw-settings.png new file mode 100644 index 000000000..816c665d2 Binary files /dev/null and b/docs/linux/vmw-settings.png differ -- cgit mrf-deployment