aboutsummaryrefslogtreecommitdiff
path: root/IDEAS.md
blob: 7a3390301dba57f7aca211df985573fde0c737f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Ideas

## Usability

* Docs (tutorial and manpage).

* Makefile and debian package.

* Patch for spice-client-gtk for menuless windows (spicec usecase).

* Systemd service for a single VM.

* Shell completions.

* Support for other Spice clients such as [Remmina](https://remmina.org).

* Support for multiple source/targets pairs (analogous to `shared_folders`) at:
  * `provision_rsync`

* Be more distro-agnostic, making any debian-specific routine as a separate function.

* Be more agnostic on some personal choices (locales, softwares etc).

* Support for per-guest `known_hosts` for SSH logins.

## Virtualization

* Config option to [disable
  networking](https://wiki.qemu.org/Documentation/Networking#How_to_disable_network_completely),
  passing `-net none`.

* [Nested virtualization](http://www.rdoxenham.com/?p=275)
  ([1](https://wiki.archlinux.org/index.php/KVM#Nested_virtualization),
  [2](https://ladipro.wordpress.com/2017/02/24/running-hyperv-in-kvm-guest/)).

## Workflow

* Continuous Integration script (kvmx-ci):
  * For schedule jobs (like cron).
  * Pull from remote repository and check source integrity.
  * Automatic VM (re-)creation and/or provisioning.
  * Logging.
  * Status report.

* Test suite for kvmx itself.

* Option `provision_always` to provision whenever a guest is started.

* A qubes-like behavior: guest configured:
  * Option 1:
    * With backing file and a basebox as a TemplateVM, using a `template_vm`
      config working along with `base` abd `backing_file`.
    * To reinitialize de backing file at every restart.
    * Guest won't start if the basebox is running.
  * Option 2:
    * Starting the VM using -snapshot param.
    * Setting the $image to the same as the basebox.
  * Use `$shared_folders` to mount custom data into the guest, allowing for
    specific /home/user contents.

* KVMX lifecycle enhancements:
  * kvmx recycle <vm-name> # kvmx stop/destroy/up/provision
  * kvmx mount   <vm-name> <host-folder> <guest-mountpoint> # live 9p mounting
  * kvmx run     <vm-name> <command-file> # uploads a script as a temp file in the guest and runs it
  * kvmx upgrade <vm-name> # upgrades via SSH using a pre-defined upgrade command in the kvmxfile,
                           # start the VM if needed, skip if no command is set (skip when backing_file=1?);
                           # that could allow for mass upgrades using `kvmx-supervise foreach upgrade`

* KVMX disposable enhancements:
  * kvmx disposable      <vm-name> [command]
  * kvmx disposable-run  <vm-name> <command-file>
  * kvmx disposable-name <vm-name> <temporary-name>
  * kvmx mat             <vm-name> <filename>
  * kvmx pdf-cleaner     <vm-name> <filename>
  * kvmx clamav          <vm-name> <folder|file>

## Folder sharing

* Try to umount all sshfs volumes in the host.

* Remount 9p shared folders and reinitialize spice-vdagent upon resume from
  disk [see possible bug](https://bugzilla.redhat.com/show_bug.cgi?id=1333072).

* Alternative folder sharing support:
  * NFS, SMB.
  * Or even [SSH to a server](https://superuser.com/questions/831659/mount-a-local-directory-to-a-remote-ssh-server)).

## Image handling

* Support for other OSes like Arch Linux, Gentoo, Alpine, CentOS and NixOS.

* Integration with [image-bootstrap](https://github.com/hartwork/image-bootstrap).

* LVM support at `kvmx-create`, with optional LUKS support for the whole volume.

* Non-superuser support for building images on `kvmx-create`, relying on a method like the following:
  * https://unix.stackexchange.com/questions/32008/how-to-mount-an-image-file-without-root-permission
  * https://wiki.debian.org/ManipulatingISOs
  * https://github.com/libfuse/libfuse/wiki/Filesystems
  * https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=all&keywords=fuse

* Additional way to handle missing image on `kvmx up` by spawning `kvmx_install` instead of `kvmx-create`.

* Fix isolinux support:
  * http://www.syslinux.org/wiki/index.php?title=Development/Testing
  * http://linux-kernel-driver.blogspot.com.br/2009/06/linux-kernel-development-using.html
  * https://bbs.archlinux.org/viewtopic.php?id=177299

* Image resize action, doing something like this, thanks to
  https://ahelpme.com/linux/online-resize-of-a-root-ext4-file-system-increase-the-space/

    # poweroff
    kvmx poweroff $guest

    # resize image
    qemu-img resize `kvmx list_image $guest` +5G

    # power up
    kvmx up $guest

    # ensure parted is installed
    #sudo apt-get install -y parted
    kvmx ssh $guest sudo apt-get install -y cloud-guest-utils

    # resize virtual machine root fs - while the partition is mounted!
    # this parted command currently need to be done manually
    #echo resizepart 2 -1 | kvmx ssh $guest sudo parted /dev/vda

    # See https://unix.stackexchange.com/questions/373063/auto-expand-last-partition-to-use-all-unallocated-space-using-parted-in-batch-m
    #     https://unix.stackexchange.com/questions/190317/gnu-parted-resizepart-in-script#202872
    #     https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1270203
    #     https://techtitbits.com/2018/12/using-parteds-resizepart-non-interactively-on-a-busy-partition/
    #     https://serverfault.com/questions/870594/resize-partition-to-maximum-using-parted-in-non-interactive-mode
    #kvmx ssh $guest sudo parted /dev/vda resizepart 2 -1 Yes
    kvmx ssh $guest sudo growpart /dev/vda 2

    kvmx ssh $guest sudo resize2fs /dev/vda2
    kvmx ssh $guest sudo touch /forcefsck
    kvmx restart $guest

## Audio fixes to avoid crackling on input

Implement an option to reduce crackling on sound input.

See:

* https://stackoverflow.com/questions/32193050/qemu-pulseaudio-and-bad-quality-of-sound#35998501
* https://www.reddit.com/r/VFIO/comments/542bw1/ha_got_rid_of_the_pulse_audio_crackling/
* https://www.reddit.com/r/VFIO/comments/ibmjs3/finally_fixed_crackling_audio_when_passing/
* https://www.reddit.com/r/VFIO/comments/746t4h/getting_rid_of_audio_crackling_once_and_for_all/
* https://www.reddit.com/r/VFIO/comments/8aqju8/audio_crackling_when_routing_output_to_pulseaudio/

Fix:

    export QEMU_AUDIO_DRV="pa"
    export QEMU_PA_SAMPLES="8192"
    export QEMU_AUDIO_TIMER_PERIOD="99"

## Simultaneous clients connections

Implement the following:

    export SPICE_DEBUG_ALLOW_MC=1

For explanation, check https://www.spice-space.org/multiple-clients.html