Surviving my days with Qubes šŸ˜…

Today I’m learning something new:

SSH for my homework, with Ubuntu and Qubes.

I used:
scp -r name@xx.xx.xx:/home/user/ ~/Documents

At first, I ran the command on the server directory, so I copied it on the same laptop :sweat_smile: Then I understood what I needed to do — run the same command, but in the destination terminal!

It took me about 4 hours to do that, to understand the process, manage the VMs, and everything else…

after that,

LuksOpen
sudo mount mapper
and qvm-block attach

qvm-copy-to-vm for send file in other VM

Because I have an offline VM and a detached sdb for safety. The sdb is in my dom0.

21:21 — Nothing worked :')) My VM didn’t have enough allocated space, so it couldn’t receive everything. Since I have a 900 GB disk that’s encrypted and only partially attached, I can’t send everything to the disk at once. When you send a file through another VM, it’s actually written in the source VM’s memory — the one you configured.

After tweaking things too much, I got lost with /mnt/mapper, luksOpen, and qvm-block.

I managed to fix my issues with /mnt/mapper and the rest. Now I just need to recreate a VM with the encrypted sdb1 disk as its allocated space. :S
Anyway, I’m going to sleep — I’ll deal with it tomorrow!

:cowboy_hat_face:

5 Likes

This kind of post belongs on a personal blog.

1 Like

Bro, thanks for your opinion, but I’m in General Discussion to share what I do in Qubes =)
If you don’t like it, just stay in another thread :wink:

2 Likes

I don’t agree. This could be useful for other users who would like to set up the same.
But it would be nice if @User.LinuxOne could make it a bit more tutorial like ( so we can all benefit from what you’ve learned) - with a dash of personal anecdotes on the side :wink:

2 Likes

Of course I’m a moron in your eyes because my opinion differs from yours. You win—how does that make you feel? :muscle:

Not everyone thinks the same, and some people may judge your comments the same quality as you judge the OP. You could have made your point in a million ways, but you chose these words.

I’m new to forums, so I’m still learning how to deal with comments like yours. Thank the universe we don’t all abide by the same posting etiquette.

At the end of the day we’re all here to learn, in whatever shape or form. :sparkling_heart:

7 Likes

We definitely don’t need any insults round here.

I would say the OP was written in the aftermath of a long and unfinished fight with compartmentalisation, so I disagree about this part (or rather, I think it’s an unfair judgement):

Additionally, I found a useful data point about the problems met by new (and not-so-new) Qubes users.

In this case, I think @User.LinuxOne had the following situation:

  • qube1 can have SSH access to a set of files on a remote server, but cannot store the data
  • qube2 has the storage space but can’t use ssh, because no network.
  • How to get the data from one to the other?
  • Ideally, qube2 would have to do an absolute minimum of processing of data from qube1

Seems it should be so simple!

After thinking about it, I realised I’m not sure how best to do this, and I’m quite glad for the OP.

Who knows an elegant and secure solution?

[Edited to correct the spell-checker. sash != ssh ]

My first idea was not very good...

The classic solution is something like:
use ssh to run tar -c myfiles on the source server, and to send a stream of data containing the files to a tar -C /home/user/destination/directory -x process which we run in the destination machine.

  • The naive and less secure method is to use two qvm-run processes in Dom0, with a pipe ā€˜|’ between the two. This is similar to how I would have done it Before Qubes.
  • A little bit better would be to set up qrexec to allow qube2 to launch the ssh command in qube1. This gives the secure qube a bit more control, and avoids any data going through Dom0…
  • BUT these solutions use the relatively complex tar format, which must be parsed in the destination, taking care not to overwrite existing files or fill existing directories with cruft.
  • Is there a more Qubes-ish way for doing it…?

An ssh-stream-proxy?

Could/should it be a two-way solution ?

Could we use qubes backup to push through it? Use a single backup command to make local and remote backups, for example.

3 Likes

Regardless of what has been said here, I would like to emphasize that the instructions stress not using the dom0 space; that is, it should not be touched or modified whenever possible. Doing so poses a potential security risk and goes against the Qubes OS philosophy.

2 Likes

Hello everyone! :cowboy_hat_face:

Thanks to all of you for your feedback. I ended up working on the topic anyway, while staying within the Qubes philosophy of security.

So here is how I ā€œsolvedā€ — or rather handled — the situation.

First, I used a disposable VM to transfer the data from my Debian machine into Qubes. The idea was to check the files afterwards, and if everything looked good, I could transfer them into the proper VM. All the configurations I had to set up for the transfer/verification process would then be wiped, keeping my VMs ā€œclean.ā€

But before anything else, I had to create an LVM structure for my sdb1 and integrate it into Qubes in order to create a VM with storage sized exactly like the disk. That way, I could transfer the files from the disposable VM directly into my ā€œStorageā€ VM.

Here’s roughly what I did:

  1. Encrypt the sdb1 disk
  2. Create a physical volume with pvcreate on the encrypted partition
  3. Create the volume group on the encrypted partition
  4. Allocate 100% of the space with:
    lvcreate -l 100%FREE -T myvg/mypool
  5. Integrate it into Qubes with:
    qvm-pool add mypool lvm_thin -o volume_group=myvg -o thin_pool=mypool -o revisions_to_keep=3
  6. Create an offline VM using mypool as its storage

Right now, as I’m writing this (gladly!), I’m in the middle of transferring the files into a dispVM, but I’m stuck when trying to transfer two folders at the same time… ā€œPermission denied.ā€ Yet after checking, I’ve got all the rights needed, and the folders are pretty much of the same type, so to speak…

I spent 5 hours after my first post, and once the research was done, the whole operation took me only 20 minutes!!
Ahhh, Linux distributions… quite the love story! :smile:

Thanks again for your feedback, and I’ve taken note that I should be a bit more detailed (like little tuto) when sharing my experience @queboss :see_no_evil:

2 Likes

Congratulations and thank you for the update. From now on, please respect the Qubes OS security model because it is the only real defense it has, and it is not absolute. Qubes OS is only… a reasonably secure system.

Yes !! @Invictus

We are the wrong equation :robot:

1 Like

I did not understand this remark of @Invictus at first, but I see that the sdb disk is used in Dom0 as a support for a qubes storage pool.

If the sdb is removable, then it could create new risks, but it depends how it is used outside the Qubes system.

If it is never used, then there is no threat to Dom0. If it gets malicious firmware installed from use in a dirty computer, then it’s bad news all round and security model is toast. There are possibilities in between.

Only @User.LinuxOne can do the calculation…

Thanks for your feedback.

No, it’s not removable; it’s a second internal storage disk in the computer, which I manage via Dom0.

What do you think? All the documents stored in the Offline VM and checked are just images, docs, etc.

Do you think there’s any risk in manipulating sdb1 via Dom0?

Unfortunately, the base of possibilities is currently infinite. Search the internet; there’s malware that can be found even in a simple *.jpg image. Now, there has to be a limit to paranoia in these matters, but you are entirely responsible for defining your risk model and security measures. I’m simply offering a well-intentioned opinion. Best regards, and please read all the documentation relevant to your interactions with Qubes. This community only provides voluntary support, and I don’t think that would be very helpful in a real emergency. Once again, your first line of defense is yourself, and probably also your last.

1 Like

Your opinion does not reveal you are a moron because it is different than a competent Qubes user but because what you posted earlier is objectively dumb.

It’s okay if you do it once in a while. But if you do it too much you will shit up the board.

If one of those .jpg are opened with an image viewer compiled with full formal proof coverage the risk is zero. coq-of-rust is not the only answer to that category of need but is one of the good ones.

Look into CVEs related to filesystems where malformed filesystem information led to unintended code execution. There is also some history around malicious firmware in hard disk controllers doing DMA attacks. Jacob Applebaum touched on the latter in his talk at Chaos Communication Congress in 2013.

TLDR: not if you use it only as a Qubes pool.

If sdb1 is used purely as a Qubes pool, created by Dom0 and directly used only by Dom0, then I do not see any risk, beyond the risk that Dom0 is already compromised by an upstream vendor, or that there is some horrible bug in xen.

The volumes in the pool are created by Dom0.
The filesystems put on the volumes in the pool are created by Dom0 by pure data copy, without using any filesystem code in Dom0.
The following are accessible only to Dom0, and to no other qube:

  • firmware of the sdb drive
  • partition table of sdb
  • raw block data of sdb
  • raw block data of sdb1

Each qube given a volume from the pool has access only to the block data from inside that volume. This is assured by xen (unless there is some horrible defect in xen), and by the volume handling code of Dom0 (unless…etc).

So… if the condition above is satisfied, and you use it that way, then I think it would be reasonable to consider that the risk is too small to worry about. If there is a risk, then it would seem very likely to be present for all your other storage pools.

If you mount any volume containing non-Dom0 data and use it inside Dom0, then it’s very different… but I think you are not doing that.

Edit: And of course, your Offline VM which allows you to look at your images and docs is exposed to everything you put inside that storage… but I think you understand that.

As I said: we’re all here to learn in whatever shape or form. I will refrain from any further comments to prevent escalation.

:peace_symbol:

1 Like

Hi everyone,

I’m currently using a Ryzen 5 with 32GB DDR4 for Qubes, and it’s feeling a bit… underpowered! :sweat_smile:

So, for Christmas, I decided to upgrade with the following:

  • 1x be quiet! Silent Base 802 - Black
  • 2x Samsung SSD 990 Pro 1TB
  • 1x MSI PRO Z790-P WIFI
  • 1x Intel Core i7-14700K (3.4 GHz)
  • 1x VIP PC assembly
  • 1x Corsair Nautilus RS Black - 360mm
  • 1x Kingston FURY Beast DDR5 - 64GB (2x32GB) - 5200MHz - CAS 40
  • 1x be quiet! Pure Power 13 M - 850W

I think it should be a solid setup! I’ll also be flashing Dasharo (BIOS). This build is based on the NitroPC Pro 2.

:christmas_tree:

2 Likes

i’m still alive :sneezing_face: :sunglasses:

2 Likes