Development Environment

59 views
Skip to first unread message

Herbies

unread,
Jun 6, 2016, 5:53:50 AM6/6/16
to qubes-devel
Hi,
I'd like to start to write code on Qubes.

I have developed some easy bash scripts that run in dom0, but now I want
to do more. I want to convert this script from bash to python and play
with qubes-manager.


How do you develop on Qubes?
how do you perform test on software that run in dom0?
The process is "test-driven"?

Thanks for help.

Herbies


Andrew David Wong

unread,
Jun 6, 2016, 6:41:28 AM6/6/16
to Herbies, qubes-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Marek can comment more on this, but the basic advice I've seen given
over the years is to have a dedicated testing system (i.e., separate
hardware) that is not used for security-critical tasks. Then you can
run experimental code and install less trusted programs in dom0.

- --
Andrew David Wong (Axon)
Community Manager, Qubes OS
https://www.qubes-os.org
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJXVVNPAAoJENtN07w5UDAwnHwP/i/W/zVxNFOe2KEEKm1oqJK+
h7uoCC9JBBz6s9gWb5A0ElYH5kILlbPhSYn3X+p+HQ16cJJiEEoks7BmkqLgNfuS
wUQuLDxcUDxucVMUVF2lY6FqHBt4H+0nVR1HPSt915ASHHbxPdBQ7WRUrZi1zP2I
0J+7HihI42rMD3zqJDXRypOWODXdmpGGe7tnGIFJc2cZDKHfgGS8hsditO5FUFgP
/dtM1jVSnSbk+6OpvqntDwpCh9uVRiWOlQOO4kk4WzSYFSJt5XVALs6SR5kMCfjZ
BEgkXRwUBZLeA56mppvoXwH+UaPk9i71lUJP9VuNaQ56FoVw4FUKeHNBfCTKI7vB
gjFZYKnCpwVb0M2VPhvISoFlk5MT/KoiKrK7sTUvYePEUnF0WRINg4YHTiPVOeKY
G1j/45di0PYu3eyA7/ozEETdnMBxirPYmU5aGZ/x18U1lg520LmArZCxziAU6uvm
u3HizXZQKY1j7ltsjVFB85e/PTR5tQwz6fIK6bmwMsAxqEjfQzJ1a7jY0zota61H
Q41rTDPKjBM2AFbkRkkyclbkkxtIsUdXm2BRW8mpaASP/IaJsC+XevC4+Lc6MuVU
EVpghy6YxqZwj7QVGVtMaimXxy/q28eb4Qxf3TXJ8VsjN51Aejky8QjB0HXljKxk
YQj/ltrHltNbUaf8iDr0
=62mF
-----END PGP SIGNATURE-----

Bahtiar `kalkin-` Gadimov

unread,
Jun 6, 2016, 8:21:43 AM6/6/16
to qubes-devel
Excerpts from Herbies's message of 2016-06-06 11:53:41 +0200:
> Hi,
> I'd like to start to write code on Qubes.

Read at https://www.qubes-os.org/doc/ the part titled *For Developers*.

> I have developed some easy bash scripts that run in dom0, but now I want
> to do more. I want to convert this script from bash to python and play
> with qubes-manager.

Depending on what you do, you probably want to play with qubes-core-admin
(https://github.com/QubesOS/qubes-core-admin/) not the qubes-manager. Qubes
Manager is just an ui which interacts with the logic in qubes-core-admin.


What you probably want to do is to study qubes-core-admin and what kind of
python modules and functions it offers. Then you can just write your python
script — which reuses the `qubes.qubes` module — in the dom0 and you don't need
a whole build environment. Have also a look at the default tools (i.e.: vim
`which qvm-ls`) to see how the Python qubes modules are used.

> How do you develop on Qubes?

This is how packages are build https://www.qubes-os.org/doc/qubes-builder/

> how do you perform test on software that run in dom0?

There're two options:

① If you develop for current QubesOS version, you can build your package in you
BUILDVM and copy it to the dom0.
② Have a secondary hardware running QubesOS, with a network card attached to the
dom0. You build your code in a BUILDVM. The dom0, on your secondary hardware,
runs an SSH daemon. BUILDVM can deploy packages and run tests via SSH on the
secondary hardware.

The second options is preferable and cleaner.

> The process is "test-driven"?

Depends on the component and your definition of test-driven. There're tests for
some components.


kalkin-
signature.asc

Marek Marczykowski-Górecki

unread,
Jun 6, 2016, 7:30:25 PM6/6/16
to Bahtiar `kalkin-` Gadimov, qubes-devel, qher...@openmailbox.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Mon, Jun 06, 2016 at 02:20:53PM +0200, Bahtiar `kalkin-` Gadimov wrote:
> Excerpts from Herbies's message of 2016-06-06 11:53:41 +0200:
> > how do you perform test on software that run in dom0?
>
> There're two options:
>
> ① If you develop for current QubesOS version, you can build your package in you
> BUILDVM and copy it to the dom0.

Example scripts and description:
https://www.qubes-os.org/doc/development-workflow/

> ② Have a secondary hardware running QubesOS, with a network card attached to the
> dom0. You build your code in a BUILDVM. The dom0, on your secondary hardware,
> runs an SSH daemon. BUILDVM can deploy packages and run tests via SSH on the
> secondary hardware.

Example scripts and description:
https://www.qubes-os.org/doc/test-bench/

> The second options is preferable and cleaner.
>
> > The process is "test-driven"?
>
> Depends on the component and your definition of test-driven. There're tests for
> some components.

https://www.qubes-os.org/doc/automated-tests/

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJXVgeHAAoJENuP0xzK19csZYQH/2BjuxCT+lz0W7t5riJfNcTW
xmIu7dUKVWsQzpruoTl/TmMo/+id+MvxC7gI3Ifl3nKlh20+TGMV2++aONtSC9TO
pxtOhEjwOFPnfo8QbrTGDSxrgBXdAWFpz9vzK/MnKqFOmRuP8r8PXLNuRDtQYxBL
pKZmwuHNM3Yv2MYQC7BojTEtiBWOFgPBo5E1PpUYNCllkGGhYVesAf37I7tKLUb4
frru5BuXfPjvz37DhT78fSGEGYgVk6gPyQc/8HrUKe74ywdd2CPFt1ZQdSTrGWp/
kYfayh46iCaptN+BZFNmxZwnC29+BZVrDXv8RRLj8wq/OQ0ZJnaYgtthXMptIlw=
=dKOK
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages