Commit Graph

200 Commits

Author SHA1 Message Date
Wojtek Porczyk
68ad60c1b3 Merge remote-tracking branch 'origin/master' into core3-devel
Conflicts:
	core/qubes.py
	doc/Makefile
	doc/manpages/qvm-prefs.rst
	doc/qvm-tools/qvm-add-appvm.rst
	doc/qvm-tools/qvm-backup-restore.rst
	doc/qvm-tools/qvm-backup.rst
	doc/qvm-tools/qvm-block.rst
	doc/qvm-tools/qvm-clone.rst
	doc/qvm-tools/qvm-firewall.rst
	doc/qvm-tools/qvm-ls.rst
	doc/qvm-tools/qvm-pci.rst
	doc/qvm-tools/qvm-run.rst
	doc/qvm-tools/qvm-shutdown.rst
	doc/qvm-tools/qvm-start.rst
	doc/qvm-tools/qvm-template-commit.rst
	qvm-tools/qvm-ls
	qvm-tools/qvm-prefs
	qvm-tools/qvm-remove
	tests/__init__.py
	vm-config/xen-vm-template.xml
2016-11-30 03:07:39 +01:00
Marek Marczykowski-Górecki
fe470dade9
Merge remote-tracking branch 'qubesos/pr/72'
* qubesos/pr/72:
  Don't allow VM name ending in -dm
2016-11-25 03:01:15 +01:00
Marek Marczykowski-Górecki
01b67a0af1
Handle both old and new shm.id path
This ease transition (installing new package will not break system).
2016-11-23 04:13:02 +01:00
Jean-Philippe Ouellet
c4f30bc3ad
Don't allow VM name ending in -dm
This is used internally for device-model stubdomains (untrusted qemu)
for HVMs, and causes conflicts when trying to boot foo (HVM) and foo-dm
(any type).

Partially fixes https://github.com/QubesOS/qubes-issues/issues/2422
2016-11-21 22:38:59 -05:00
Marek Marczykowski-Górecki
85f6ff9ded
Merge remote-tracking branch 'qubesos/pr/47'
* qubesos/pr/47:
  Move /var/run/shm.id to /var/run/qubes/shm.id
2016-11-11 16:13:51 +01:00
Marek Marczykowski-Górecki
800fcfd880
Do not start guid if DISPLAY is not set
Fixes QubesOS/qubes-issues#2408
2016-10-30 01:31:53 +02:00
Vít Šesták
00a96d1d5b Change way of detection KDE so that it detects KWin in other environments 2016-09-08 23:31:27 +02:00
Marek Marczykowski-Górecki
4e022382a5
Merge remote-tracking branch 'origin/master' into core3-devel 2016-08-08 00:11:46 +02:00
Jasper Tron
cfbb786d7f Move /var/run/shm.id to /var/run/qubes/shm.id
This allows the gui daemon to be run without root privileges.
2016-07-25 21:17:10 -05:00
Marek Marczykowski-Górecki
521e96f2c3
Revert "core: detach PCI devices before shutting down VM"
Many drivers, including iwlwifi doesn't handle this well, resulting in
oopses etc. Also we're disabling PCI hotplug, which may be result in
more troubles here.
This reverts commit 2658c9a6e6.

QubesOS/qubes-issues#1673
2016-07-16 21:10:29 +02:00
Marek Marczykowski-Górecki
da74d75e6b
core: collect stderr too when vm.run_service is called with passio_popen
Give access to all file descriptors when requested.
2016-07-12 06:24:07 +02:00
Marek Marczykowski-Górecki
8c7f072461
core: fix handling vm.start_time for just shutdown VM
That xenstore entry may be already removed even when libvirt still
reports the VM as running.

Fix QubesOS/qubes-issues#2127
2016-07-01 00:47:32 +02:00
HW42
f6bc97d65b
save pci_e820_host property 2016-06-29 23:51:51 +02:00
Marek Marczykowski-Górecki
748a3a90a2
core: fix handling disabling VM autostart on VM removal
QubesOS/qubes-issues#1930
2016-06-25 00:20:27 +02:00
Wojtek Porczyk
6a10daf7be Merge branch 'master' into core3-devel
Remains to be fixed:
  88cb62fc
  d2640b51
  958c2926
2016-06-13 19:03:46 +02:00
Marek Marczykowski-Górecki
d0ba43f253
core: start guid as normal user even when VM started by root
Another attempt to avoid permissions-related problems...

QubesOS/qubes-issues#1768
2016-06-06 02:21:08 +02:00
Marek Marczykowski-Górecki
89d002a031
core: use runuser instead of sudo for switching root->user
There are problems with using sudo in early system startup
(systemd-logind not running yet, pam_systemd timeouts). Since we don't
need full session here, runuser is good enough (even better: faster).
2016-06-06 02:19:51 +02:00
Marek Marczykowski-Górecki
2265fd3d52
core: start qubesdb as normal user, even when VM is started by root
On VM start, old qubesdb-daemon is terminated (if still running). In
practice it happen only at VM startart (shutdown and quickly start
again). But in that case, if the VM was started by root, such operation
would fail.
So when VM is started by root, make sure that qubesdb-daemon will be
running as normal user (the first user in group 'qubes' - there should
be only one).

Fixes QubesOS/qubes-issues#1745
2016-06-06 02:19:28 +02:00
Marek Marczykowski-Górecki
88cb62fcf6
core: add pci_e820_host property
Enable e820_host option for VMs with PCI devices (to allow VM kernel to
deal with address space conflicts). But add a property to allow
disabling it.

Fixes QubesOS/qubes-issues#2019
2016-06-04 16:52:02 +02:00
Marek Marczykowski-Górecki
3afc7b7d50
core: start qrexec-daemon as normal user, even when VM is started by root
qrexec-daemon will start new processes for called services, which
include starting new DispVM, starting other required VMs (like backend
GPG VM). Having those processes as root leads to many permissions
problems, like the one linked below. So when VM is started by root, make
sure that qrexec-daemon will be running as normal user (the first user
in group 'qubes' - there should be only one).

QubesOS/qubes-issues#1768
2016-05-26 01:34:53 +02:00
Marek Marczykowski-Górecki
94d52a13e7
core: adjust guid parameters when running on KDE5
On KDE5 native decoration plugin is used and requires special properties
set (instead of `_QUBES_VMNAME` etc).
Special care needs to be taken when detecting environment, because
environment variables aren't good enough - this script may be running
with cleared environment (through sudo, or from systemd). So check
properties of X11 root window.

QubesOS/qubes-issues#1784
2016-05-17 20:22:13 +02:00
Marek Marczykowski-Górecki
92b49fe9a4
core: Change default vCPUS to 2
This behaves better when running multiple VMs. If one need full CPU
power in some VM, it is always possible to increase vCPUs for this
particular VM.

Fixes QubesOS/qubes-issues#1891
2016-05-15 14:00:37 +02:00
Mario Geckler
23ec9e92bb
removed unnecessary comparison with True and changed to sysctl instead of remove 2016-04-28 08:30:57 +02:00
Mario Geckler
d9b8516b6d
Fixed #1930: Delete autostart Symlink when deleting a VM 2016-04-27 12:47:56 +02:00
Marek Marczykowski-Górecki
8c6fe7ed90
Merge remote-tracking branch 'origin/master' into core3-devel-mm 2016-04-11 13:03:12 +02:00
Marek Marczykowski-Górecki
046149e0f4
core: fix vm.run_service 'wait' argument handling
1. wait=False isn't supportet together with localcmd (explicit, or
   implicit via 'input') - qrexec-client refuses such combination
2. When using localcmd, qrexec-client exists as soon as the local command
   terminates, not necessary remote. This may not be desired effect when
   used with wait=True (the default), so do not use localcmd in such a
   case

Found while debugging tests for qubes.USBAttach/qubes.USBDetach - with
wait=True broken, there were a lot of race conditions.

Related to QubesOS/qubes-issues#531
2016-04-01 02:53:04 +02:00
Marek Marczykowski-Górecki
65255626e2
core: add separate QubesDB entry for primary DNS address
Fixes QubesOS/qubes-issues#1817
2016-03-07 03:54:21 +01:00
Marek Marczykowski-Górecki
280a0743c2
core: typo fix in error handling cont
s/VIR_INTERNAL_ERROR/VIR_ERR_INTERNAL_ERROR/

Related to QubesOS/qubes-issues#1537
Fixes QubesOS/qubes-issues#1804
2016-03-03 23:47:38 +01:00
Wojtek Porczyk
9eafa57539 Merge remote-tracking branch 'marmarek/master' into core3-devel
The following list is bollocks. There were many, many more.

Conflicts:
    core-modules/003QubesTemplateVm.py
    core-modules/005QubesNetVm.py
    core/qubes.py
    core/storage/__init__.py
    core/storage/xen.py
    doc/qvm-tools/qvm-pci.rst
    doc/qvm-tools/qvm-prefs.rst
    qubes/tools/qmemmand.py
    qvm-tools/qvm-create
    qvm-tools/qvm-prefs
    qvm-tools/qvm-start
    tests/__init__.py
    vm-config/xen-vm-template-hvm.xml

This commit took 2 days (26-27.01.2016) and put our friendship to test.
    --Wojtek and Marek
2016-03-03 01:13:51 +01:00
Marek Marczykowski-Górecki
9fa090b422
core: prevent VM renaming over already existing VM
Fixes QubesOS/qubes-issues#1723
2016-02-08 04:38:26 +01:00
Marek Marczykowski-Górecki
0b5bd060bb
Fix domain renaming when it wasn't defined in libvirt
Fixes QubesOS/qubes-issues#1632
2016-02-06 05:36:07 +01:00
Marek Marczykowski-Górecki
8ee909f08c
Caught unknown libvirt errors on getting runtime VM info
In some cases libvirt doesn't report error code at all. This probably
happens in some stage of domain startup/shutdown. Threat this the same
as domain not running.

Fixes QubesOS/qubes-issues#1537
2016-02-06 05:34:22 +01:00
Marek Marczykowski-Górecki
530a79417f
Add some logging to ease debugging libvirt errors
Temporary add some more logging to ease debugging libvirt errors.
Unfortunatelly stack trace doesn't contain actual error.

QubesOS/qubes-issues#1537
2016-01-07 05:48:33 +01:00
Marek Marczykowski-Górecki
9809e4168e
core: log pci detach error on VM shutdown
Thanks @Rudd-O for pointing this out.
2015-12-26 14:05:21 +01:00
Marek Marczykowski-Górecki
e3e8a55c92
core: forbid 'lost+found' as VM name
When /var/lib/qubes/appvms is a mount point of ext4 filesystem, there
will be already 'lost+found' directory. Avoid this conflict.

Fixes QubesOS/qubes-issues#1440
2015-12-26 03:02:23 +01:00
Marek Marczykowski-Górecki
d539bd2be1
core: preserve qrexec-timeout during VM clone
Fixes QubesOS/qubes-issues#1501
2015-12-23 19:07:18 +01:00
Marek Marczykowski-Górecki
027ffedec4
core: typo fix in error handling 2015-12-07 00:03:39 +01:00
Marek Marczykowski-Górecki
2658c9a6e6
core: detach PCI devices before shutting down VM
When VM is shutting down it doesn't disconnect PCI frontend (?), so when
VM is destroyed it ends up in timeouts in PCI backend shutdown (which
can't communicate with frontend at that stage). Prevent this by
detaching PCI devices while VM is still running.

Fixes QubesOS/qubes-issues#1494
Fixes QubesOS/qubes-issues#1425
2015-12-06 14:31:43 +01:00
Marek Marczykowski-Górecki
f525a58134
core: adjust for updated stubdom support in libvirt
Fixes QubesOS/qubes-issues#1456
2015-11-27 20:00:33 +01:00
Marek Marczykowski-Górecki
cc3ab7aaa1
Merge remote-tracking branch 'qubesos/pr/11'
* qubesos/pr/11:
  libvirtError in _update_libvirt_domain is no longer silently swallowed.
2015-11-25 03:46:55 +01:00
Vít Šesták
eb97c5652f libvirtError in _update_libvirt_domain is no longer silently swallowed.
I had some issue with fstrim and the missing else had caused the code to continue and fail later with a non-descriptive error message. This commit makes the error message more descriptive and helpful.
2015-11-25 01:16:27 +01:00
Bahtiar `kalkin-` Gadimov
2ebd20049d Refactor appmenus paths to core-admin-linux 2015-11-22 12:21:40 +01:00
Bahtiar `kalkin-` Gadimov
710b95a6ac Fix app icons errors 2015-11-17 19:37:20 +01:00
Bahtiar `kalkin-` Gadimov
78891dd70f QubesVm save the name of the storage pool used 2015-11-17 19:37:19 +01:00
Marek Marczykowski-Górecki
4316027fb1
core: Add 'wait' parameter to vm.run_service function
Sometimes it makes sense to "fire and forget" a service. For example
"qubes.InstallUpdatesGUI".

QubesOS/qubes-issues#1249
2015-11-13 05:43:40 +01:00
Marek Marczykowski-Górecki
540fe3f552
core: set vm.uses_default_kernel=False when setting vm.kernel
Forgetting this leads to misterious errors (VM started with different
kernel than it was just set), so simplify the API.

Fixes QubesOS/qubes-issues#1400
2015-11-10 17:07:57 +01:00
Marek Marczykowski-Górecki
ba54792c83
core: make modules.img optional even for PV
When using PVGrub it doesn't make sense to attach modules.img, since
modules are already in the VM. Initramfs there will already handle such
situation and will not try to mount it, when VM's root filesystem
already contains appropriate /lib/modules/`uname -r`.

On the other hand, error earlier when initramfs is missing. While also
not used by PV Grub, the file is always specified in libvirt config and
when missing libvirt will throw rather cryptic error message.

QubesOS/qubes-issues#1354
2015-11-10 17:04:50 +01:00
Marek Marczykowski-Górecki
34f7ddd41e
core: force QubesDB reconnection on VM start 2015-11-07 05:43:34 +01:00
Marek Marczykowski-Górecki
1c0ade6166
Fix race condition in QubesVm.get_cputime/get_mem
When domain is destroyed after isActive check, but before getting
actuall info, it would fail. So handle this situation.
2015-10-27 21:35:02 +01:00
Marek Marczykowski-Górecki
75168c8aef
core: improve handling QubesDB startup errors
Kill the VM when QubesDB initialization fails, in any way, not only
QubesDB daemon itself.
2015-10-13 23:49:32 +02:00