How to get Ubuntu 18.04 running in a HVM with a GUI desktop in Qubes OS 4.0.3 ?

80 views
Skip to first unread message

M

unread,
Mar 16, 2020, 9:14:11 AM3/16/20
to qubes-users
How to get Ubuntu 18.04 running in a HVM with a GUI desktop in Qubes OS 4.0.3 ?

I hope to get an answer from the Qubes OS users who have experience in using Ubuntu in Qubes OS.

I got this error since the first time I restarted the HVM after the installation of Ubuntu 18.04:

"FAILED to start User Manager for UID 121...
...
Removed slice User Slice of gdm.
Created slice User Slice of gdm.
...
FAILED to start User Manager for UID 121
...
Started Session c... of user gdm.
Started User Manager for UID 121.
Stopped User Manager for UID 121
...
Removed slice User Slice of gdm.
Created slice User Slice of gdm.
...
Started Hold until boot process finishes up."

[Then nothing more happens]


Here is a description of what I have done to install Ubuntu 18.04:

1)  Downloaded Ubuntu 18.04 from ubuntu.com to a VM.

2)  Clicked on "Create Qubes VM" in the Qubes Menu.

3)  Gave the HVM a name, chose "Empty standalone qube (install your own OS)" and selected "launch settings after creation".

4)  In "Qube Settings": Set "System storage max. size" to 50.240 MiB, clicked on Advanced and set "Initial memory" to 4000 MiB, clicked on "Apply" and then click on "Boot qube from CDROM" and chose the VM and the ISO-file and clicked on apply.

5)  Chose "Install" in the Grub menu in the newly appeared window.

6)  Followed the installation guide and chose "Full format and installation".

7)  Restarted the HVM afterwards.


I hope to get some suggestions on how to get further.

redpo...@gmail.com

unread,
Mar 16, 2020, 1:48:13 PM3/16/20
to qubes-users
Good luck with this.  I have managed to install Ubuntu but you only get a small window (which apparently is fixable but I didn't go there).  Networking is difficult and I could never get it to recognise my wifi adapter.  You could always try and install an Ubuntu template from here: https://qubes.3isec.org/Templates_4.0/  but that entails installing the template in dom0 which I wasn't real keen on.  There is guide here on how to do it.  Let me know if you can't find it and you want it.

I also into the problems that you are citing.  I solved it by mucking around with installing it on xvda then xvdb etc.  I changed the virtual drive installation options and it worked.  But I'm just letting you know that you will opening a door to some more challenges.  I was trying to install Ubuntu because I know it and I can set up my printers etc, but I gave up and went through the learning of doing all of this on a Fedora template in qubes which was a better result anyway.

Good luck.  Let us know how you go. 

M

unread,
Mar 16, 2020, 3:12:35 PM3/16/20
to qubes-users
1)  Thanks for the optimistic view. :)

2)  Regarding the small window: Have you tried to change the screen resolutions in Ubuntu ? - although you can't get full screen, it should be possible to get it at least almost full screen. It works in both Windows 10, Linux Mint and Debian 10.3.

3)  For me it's fine if just I can get on the internet from within Ubuntu by using a cable connection ? - I haven't been able to get it working in a Debian GUI HVM, but at least in a Windows 10 and Linux Mint HVM. But I would like to install a program that only works with Debian and Ubuntu, so I need to at least get either Debian or Ubuntu to work and being able to connect to the internet.

4)  Thanks for the link. For me this one sounds relevant: https://qubes.3isec.org/Templates_4.0/qubes-template-bionic-desktop-4.0.1-202001121248.noarch.rpm  as I guess it has a desktop with a GUI.
     To use it, shall I then just download it to a VM, copy it to dom0 by executing this command; qvm-run -p <build_qube> "cat '/home/user/Downloads/qubes-template-bionic-desktop-4.0.1-202001121248.noarch.rpm'" > qubes-template-bionic-desktop-4.0.1-202001121248.noarch.rpm  I guess "<build_qube>" shall be replaced by the name of the new template, is that correct ?
     And do I then just need to run this command to execute the file and get the template created with a GUI desktop: chmod +x qubes-template-bionic-desktop-4.0.1-202001121248.noarch.rpm && ./qubes-template-bionic-desktop-4.0.1-202001121248.noarch.rpm ?

5)  Do I understand you correctly, that you installed Ubuntu as LVM, and that worked... ? - If so, what options did you change. to make it work ? - Then I might try that first.


drbg...@gmail.com

unread,
Mar 16, 2020, 4:41:32 PM3/16/20
to qubes-users
I installed Ubuntu as a HVM and had to muck around with the disc it installed on as I said (xvda/xvdb etc).  Some worked some didn't.

With regards to resolution I did try from within Ubuntu but the maximum resolution was I think 800X600 which is tiny and it didn't give me any more options.  Supposedly this is fixable, but I didn't go there.  If you get that far you will see that the display window cuts off your ability to access the resolution drop down bar on the right.  Grab the window in the middle and pull the entire thing to the left and you can then get to the drop down bar, but mine only had the one resolution option.

I didn't go down the template path but Sven kindly posted this below as a guide.  It probably recreates what you said, but it may provide some finer detail.  

Again, let me know how you get on. 

Here's the post:  


I'll take a shot at it.

Let's say you have a VM called 'web' in which you downloaded a file
'template.rpm' which is not stored under
/home/user/Downloads/template.rm in that 'web' VM.

You want to transfer it to dom0.

So in dom0 you will be using a command called qvm-run, which allows you
to run/start programs inside VMs. It has a parameter called --pass-io
which let's you see the output of that program in your dom0 terminal.

You can test this for example with a simple text file. In your 'web' VM
start a terminal and use gedit to create a text file test.txt in your
home directory (/home/user/test.txt). Put some "hello world!" text
inside and safe it / close gedit. Not in your terminal write "cat
/home/user/test.txt" and you will see the contents of that text file in
the terminal.

Next, go to dom0 and open a terminal there. In that terminal write:
"qvm-run --pass-io web 'cat /home/user/test.txt'"

Now you see the context of the text file in your dom0 terminal. The
final step is to add something to the end of this command: "qvm-run
--pass-io web 'cat /home/user/test.txt' > /home/user/test.txt

When you run this, instead of seeing the output in the terminal it is
now written into /home/user/test.txt in dom0! You can verify with "cat
/home/user/test.txt"

I've explained this with a little text file to make it easy to
understand. Back to your /home/user/Downloads/template.rpm in the web
VM. We can use the same mechanism:

qvm-run --pass-io web 'cat /home/user/Downloads/template.rpm' >
/home/user/template.rpm

It'll take a few secondes or maybe even a minute depending on your
computer and the size of the file. But when it's done you know have
successfully copied the template.rpm into dom0 and can now run

sudo dnf install template.rpm

This is all described a bit more brief at
https://www.qubes-os.org/doc/copy-from-dom0/

Cheers,
/Sven

M

unread,
Mar 17, 2020, 6:01:14 AM3/17/20
to qubes-users
Thanks, the detailed description helped to better understand the commands.

So in order to install one of the template-files, the user has to do this:

1)  Download the template-file to a VM from this link: https://qubes.3isec.org/Templates_4.0/
     I will try to download the following file as I would like to get a GUI desktop: https://qubes.3isec.org/Templates_4.0/qubes-template-bionic-desktop-4.0.1-202001121248.noarch.rpm

2)  Copy the file to dom0 by executing this command in the dom0 terminal: qvm-run --pass-io The_name_of_the_VM_the_template-file_was_downloaded_to 'cat /home/user/Downloads/template.rpm' > /template.rpm
     Remember to write the name of the VM the template-file was downloaded to instead of "The_name_of_the_VM_the_template-file_was_downloaded_to" and the name of the template-file instead of "template".

3)  To check that the file is copied to dom0, execute this command in the dom0 terminal: ls

4)  To install the template, execute this command in the dom0 terminal: sudo dnf install template.rpm
     Info: The "dnf install" command is used to install a specific package.

If the user shall do any other things to install the template and make it run properly, please write the steps in a detailed way so that all qubes-users are able to follow the steps.

If these steps is all the steps the user has to make to get the template up and running, please write this in a comment.

I will then try to install the template, see how it works and return with a comment about this.


M

unread,
Mar 17, 2020, 6:10:07 AM3/17/20
to qubes-users
I have installed the template by following the guide I published before, which is quite easy.

After the installation, I get a short-cut in the "Qubes menu" labelled "Template: bionic-desktop" with these sub-short-cuts: 1) Help, 2) Qube Settings and 3) Terminal.

When pressing on help, a Ubuntu help page appear.

I don't see any sign of a GUI desktop...

Maybe I have to do some more... But what ?

I need someone to guide me in order to get further.

Please write how I shall continue.

Sven Semmler

unread,
Mar 17, 2020, 11:22:24 AM3/17/20
to M, qubes-users
On Tue, Mar 17, 2020 at 03:10:07AM -0700, 'M' via qubes-users wrote:
> After the installation, I get a short-cut in the "Qubes menu" labelled
> "Template: bionic-desktop" with these sub-short-cuts: 1) Help, 2) Qube
> Settings and 3) Terminal.
>
> When pressing on help, a Ubuntu help page appear.
>
> I don't see any sign of a GUI desktop...

In Qubes the desktop currently resides in Dom0 and is XFCE by default.
The "-desktop" part in the name of the template simply means that the
template contains all the Ubuntu desktop applications.

If you actually want a window with the Ubuntu desktop your only option
is to install Ubuntu in a HVM, but then you need to install the specific
qubes agent programs in it to restore the file transfer / copy & paste
facilities.

Tip: if you launch "Qube Settings" and go to the applications tab you
will see a list of all the apps that are available in this template. By
adding them to the right side, they will appear in the Qubes Menu. Maybe
that gives you what you want?

/Sven

--
public key: https://www.svensemmler.org/0x8F541FB6.asc
fingerprint: D7CA F2DB 658D 89BC 08D6 A7AA DA6E 167B 8F54 1FB6

signature.asc

M

unread,
Mar 17, 2020, 1:36:24 PM3/17/20
to qubes-users
Arh, thank you. I didn't know that.

Can the need to install the specific qubes agent programs in the HVM be the reason why I haven't been able to surf the web from inside a Debian HVM ? - you may see my other thread about this.

When it is possible to only make shortcuts in the Qube Menu for the programs that I would like to use, can I then delete the template again and just install the music programs I would like to use in the preinstalled Debian template... ?

If so:

1)  Shall I just delete the Ubuntu template Qube again by open the Qube Manager and click on delete qube, or do I have to delete other things ?

2)  Can I just delete the Template file from dom0 by using the file manager, or do I have to delete or edit other files and if so which ?

3)  How can I install a specific program in the preinstalled Debian 10 template - for example this program: https://flavio.tordini.org/musique ?

Sven Semmler

unread,
Mar 17, 2020, 1:51:56 PM3/17/20
to M, qubes-users
On Tue, Mar 17, 2020 at 10:36:24AM -0700, 'M' via qubes-users wrote:
> Can the need to install the specific qubes agent programs in the HVM be the
> reason why I haven't been able to surf the web from inside a Debian HVM ? -
> you may see my other thread about this.

Nope. For that you only have to check the assigned IP, subnet and
gateway in the Qube Manager UI for that particular qube and then apply
those settings inside the HVM.

See also "Setting up networking for HVMs" on this page: https://www.qubes-os.org/doc/standalone-and-hvm/

> When it is possible to only make shortcuts in the Qube Menu for the
> programs that I would like to use, can I then delete the template again and
> just install the music programs I would like to use in the preinstalled
> Debian template... ?

I'm not entirely sure I understand your question correctly.

-> Using the Qube Manager you can select which applications that are
installed in any particular template will show in the Qube Menu.

-> If all this effort was only about a particular program then yes: you
should have stated your need / intent more clearly at the beginning. You
can simply install that program in whatever template you use (debian,
fedora ... whatever)

> 1) Shall I just delete the Ubuntu template Qube again by open the Qube
> Manager and click on delete qube, or do I have to delete other things ?

You installed it via RPM so the clean way is to uninstall it via 'sudo
dnf erase name_of_the_package' in dom0

> 2) Can I just delete the Template file from dom0 by using the file
> manager, or do I have to delete or edit other files and if so which ?

That would result in issues down the road if you'd ever want to install
this template again (basically you would leave the system in a state
where it thinks the template is already installed). Don't do that.

> 3) How can I install a specific program in the preinstalled Debian 10
> template - for example this program: https://flavio.tordini.org/musique ?

Follow these instruction inside the template: https://askubuntu.com/questions/40779/how-do-i-install-a-deb-file-via-the-command-line#40781
signature.asc

M

unread,
Mar 17, 2020, 2:02:52 PM3/17/20
to qubes-users
Thank, you very much !

I prefer a GUI-approach, but if that can't be done, I'll try the terminal as a secondary/last approach.

I'll look into it.

M

unread,
Mar 18, 2020, 9:24:30 AM3/18/20
to qubes-users
I have tried to uninstall the template by executing this command in dom0:  sudo dnf erase qubes-template-bionic-desktop-4.0.1-202001121248.noarch.rpm

Then the terminal return:
Error: No packages marked for removal."


Sven Semmler

unread,
Mar 18, 2020, 10:48:20 AM3/18/20
to M, qubes-users
On Wed, Mar 18, 2020 at 06:24:30AM -0700, 'M' via qubes-users wrote:
> What shall I write instead of "
> qubes-template-bionic-desktop-4.0.1-202001121248.noarch.rpm

sudo dnf erase qubes-template-bionic-desktop
signature.asc
Reply all
Reply to author
Forward
0 new messages