Documenting XRDP setup which worked for me on Ubuntu Mate 20.04.
Some parts are taken from: http://c-nergy.be/blog/?p=14093.
sudo apt install xrdp
| #!/usr/bin/env bash | |
| set -e | |
| cd ~ | |
| sudo -v | |
| # Make sure system is in a good, updated, clean, state. | |
| sudo apt-get -y update |
| #!/usr/bin/env python | |
| import http.server | |
| import ssl | |
| # Create certifcate and key: https://github.com/stephenbradshaw/pentesting_stuff/blob/master/example_code/create_self_signed_https_certs.py | |
| context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) | |
| context.load_cert_chain(certfile="https_self_signed_cert.pem", keyfile="https_self_signed_key.pem") | |
| httpd = http.server.HTTPServer(('127.0.0.1', 443), http.server.SimpleHTTPRequestHandler) |
| #!/bin/bash | |
| # SPDX-License-Identifier: MIT License | |
| # Steps: | |
| # 1) Make sure bash is available | |
| # 2) Create udev rule | |
| # - path to new udev rule: /etc/udev/rules.d/50-x-resize.rules | |
| # - udev rule content: | |
| # ACTION=="change",KERNEL=="card0", SUBSYSTEM=="drm", RUN+="/usr/local/bin/x-resize" | |
| # 3) Create /var/log/autores directory | |
| # 4) Create script /usr/local/bin/x-resize (this file) and make executable |
Documenting XRDP setup which worked for me on Ubuntu Mate 20.04.
Some parts are taken from: http://c-nergy.be/blog/?p=14093.
sudo apt install xrdp
| import requests | |
| def format_bytes(size): | |
| # 2**10 = 1024 | |
| power = 2 ** 10 | |
| n = 0 | |
| power_labels = {0: '', 1: 'K', 2: 'M', 3: 'G', 4: 'T'} | |
| while size > power: | |
| size /= power |
Information can be put into dmi tables via some qemu-system hosts (x86_64 and aarch64). That information is exposed in Linux under /sys/class/dmi/id and can be read with dmidecode. The names are very annoyingly inconsistent. The point of this doc is to map them.
See qemu-system-x86_64 --help for the fields that qemu will accept.
qemu smbios flags vary with qemu version.
Example qemu cmdline:
qemu-system-x86_64 -smbios type=,field=value[,...]
| <?xml version="1.0"?> | |
| <!-- Copyright (C) 2010-2017 Free Software Foundation, Inc. | |
| Copying and distribution of this file, with or without modification, | |
| are permitted in any medium without royalty provided the copyright | |
| notice and this notice are preserved. --> | |
| <!DOCTYPE target SYSTEM "gdb-target.dtd"> | |
| <target> | |
| <architecture>i8086</architecture> |
| <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> | |
| <!-- ... --> | |
| <qemu:commandline> | |
| <qemu:arg value='-acpitable'/> | |
| <qemu:arg value='file=/some/path/slic.bin'/> | |
| <qemu:arg value='-acpitable'/> | |
| <qemu:arg value='file=/some/path/msdm.bin'/> | |
| <qemu:arg value='-smbios'/> | |
| <qemu:arg value='file=/some/path/smbios_type_0.bin'/> | |
| <qemu:arg value='-smbios'/> |