aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-12-30 16:15:14 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-12-30 16:15:14 -0200
commit4882bc0e6d31e804e4456656c629806eb59eca0a (patch)
treebbcc7e14c68fb76062265c20c6c371c6ea6460cc /share
parentcf9577525e94ff7972edf2b03979b41abdedb95b (diff)
downloadkvmx-4882bc0e6d31e804e4456656c629806eb59eca0a.tar.gz
kvmx-4882bc0e6d31e804e4456656c629806eb59eca0a.tar.bz2
Serial console support thanks to kvm-manager
Diffstat (limited to 'share')
-rwxr-xr-xshare/provision/development13
-rw-r--r--share/screen/screenrc85
2 files changed, 97 insertions, 1 deletions
diff --git a/share/provision/development b/share/provision/development
index 2a31117..0f44c07 100755
--- a/share/provision/development
+++ b/share/provision/development
@@ -85,12 +85,23 @@ if ! grep -q "/swapfile" /etc/fstab; then
sudo update-initramfs -u
fi
-# GRUB configuration
+# GRUB timeout
if ! grep -q "GRUB_TIMEOUT=1" /etc/default/grub; then
sudo sed -i -e 's|GRUB_TIMEOUT=5|GRUB_TIMEOUT=1|' /etc/default/grub
sudo update-grub
fi
+# Serial console support for VMs not created by a recent kvmx-create
+if ! grep -q "GRUB_TERMINAL=serial" /etc/default/grub; then
+ # Serial console support
+ echo '' | sudo tee -a /etc/default/grub > /dev/null
+ echo '# Custom configuration' | sudo tee -a /etc/default/grub > /dev/null
+ echo 'GRUB_TERMINAL=serial' | sudo tee -a /etc/default/grub > /dev/null
+ echo 'GRUB_SERIAL_COMMAND="serial --speed=115200"' | sudo tee -a /etc/default/grub > /dev/null
+ echo 'GRUB_CMDLINE_LINUX="console=ttyS0,115200n8"' | sudo tee -a /etc/default/grub > /dev/null
+ sudo update-grub
+fi
+
# Fstrim
# See https://pve.proxmox.com/wiki/Shrink_Qcow2_Disk_Files
sudo fstrim -av
diff --git a/share/screen/screenrc b/share/screen/screenrc
new file mode 100644
index 0000000..0a76b80
--- /dev/null
+++ b/share/screen/screenrc
@@ -0,0 +1,85 @@
+# default screenrc file for kvm-manager sessions (copied from cereal's screenrc)
+
+# use C-\ as the escape character
+escape \034\034
+
+logfile ./servicelog
+logfile flush 1
+
+# unset important key bindings
+## prevent external command execution
+bind :
+## prevent opening new windows
+bind c
+bind ^c
+## prevent ability to turn off logging
+bind H
+## prevent terminal reset
+bind Z
+## unset kill commands, sincepreference is to "detach")
+## (should unset "quit" too, or is it useful to have a backup "kill"?)
+bind ^k
+bind k
+bind K
+bind \
+bind \\
+bind ^\
+## no lockscreen:
+bind ^x
+bind x
+## no monitor, prev, next:
+bind M
+bind ^@
+bind n
+bind ^N
+bind ' '
+bind ^H
+bind ^P
+bind p
+bind ^?
+# no number:
+bind N
+# no clear:
+bind C
+# no displays or dumptermcap:
+bind *
+bind .
+# no window switching:
+bind -
+bind 0
+bind 1
+bind 2
+bind 3
+bind 4
+bind 5
+bind 6
+bind 7
+bind 8
+bind 9
+## no window splitting:
+bind S
+# no title change
+bind A
+# no remove
+bind X
+# no windows:
+bind ^w
+bind w
+# no suspend:
+bind ^z
+# no focus:
+bind ^i
+# no windowlist:
+bind \"
+
+# set default shell to be /bin/false
+# this is a little redundant with unsetting the create new window keys
+shell /bin/false
+
+# set a nice, informative caption
+caption always "%{= bw}%f %{+b w}KVM console: %{+b y}%t%{-b w} %= %Y-%m-%d %c %= %{-b}\"C-\ d\" to detach"
+
+startup_message off
+defscrollback 1024
+
+defutf8 on