Commit Graph

285 Commits

Author SHA1 Message Date
unman
19e68bacf2
Do the right thing on removal of proxyVM used as dispvm_netvm 2017-01-06 18:40:09 +00: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
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
6068c7bc50
core: fix handling uses_default_netvm property
- for netvm it doesn't make sense, but instead of removing it (which
        surely will break some code), make it always False
- when settings VM connections, uses_default_netvm is already loaded
- handle it properly during backup restore (really use default netvm,
        istead of assuming it's the same as during backup)
2016-07-17 03:56:11 +02: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
Marek Marczykowski-Górecki
5921dd2a1c
core: validate dom0 drive path before starting VM
This is very easy if the file/device is in dom0, so do it to avoid
cryptic startup error (`libvirtError: internal error: libxenlight failed
to create domain`).

Fixes QubesOS/qubes-issues#1619
2016-06-21 18:39:13 +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
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
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
31a3796ed3
dispvm: do not remove innocent files when cleaning up DispVM
Fixes QubesOS/qubes-issues#1662
2016-01-20 02:51:57 +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
35cb82cd2b
storage: use root-cow.img for HVM template, to support reverting changes
We still can't support running HVM template and its VMs simultaneously
(easily), but still, have root-cow.img handled for HVM template, to
allow qvm-revert-template-changes.

Fixes QubesOS/qubes-issues#1573
2016-01-07 05:48:32 +01:00
Marek Marczykowski-Górecki
b26f2a73b4
core: mark QubesTemplateHVm.rootcow_img as property
Add missing '@property'.

QubesOS/qubes-issues#1573
2016-01-07 05:48:32 +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
1b5daea771
qvm-grow-root: add --allow-start option
In some (most) cases VM needs to be started to complete resize
operation. This may be unexpected, so make it clear and do not start the
VM when the user did not explicitly allow that.

Fixes QubesOS/qubes-issues#1268
2015-12-26 04:10:20 +01:00
Marek Marczykowski-Górecki
49c1ab2f99
qvm-grow-root: wait for VM to shutdown at the end
Otherwise it could lead to some race conditions, for example when the
user tries to start some application there afterwards.

QubesOS/qubes-issues#1268
2015-12-26 04:08:12 +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
d4a42093b1
dispvm: Start required NetVM first (if necessary)
The comment "calling VM have the same netvm" doesn't apply to:
 - DispVM started from dom0 menu
 - DispVM started from a VM with `dispvm_netvm` property modified

Fixes QubesOS/qubes-issues#1334
2015-12-23 19:24:25 +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
28886390b4
Merge branch 'always-stubdom-guid' 2015-11-28 05:10:54 +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
7359e394bc
core: detach connected VMs when shutting down NetVM
This is workaround for missing libxl/libvirt functionality: QubesOS/qubes-issues#1426

Also it should improve system shutdown time, as this is the situation
where all the VMs are shutting down simultaneously.

Fixes QubesOS/qubes-issues#1425
2015-11-15 02:06:18 +01:00