Skip to content

Conversation

@hoshinolina
Copy link
Contributor

Otherwise Firefox launched in the guest will concurrently access the host profile, corrupting it. We can make it not do that by implementing locks, which would fix the corruption but would still break the browser in the guest. So let's explicitly set a muvm-private Firefox profile.

Otherwise Firefox launched in the guest will concurrently access the
host profile, corrupting it. We can make it not do that by implementing
locks, which would fix the corruption but would still break the browser
in the guest. So let's explicitly set a muvm-private Firefox profile.

Signed-off-by: Asahi Lina <lina@asahilina.net>
@teohhanhui
Copy link
Collaborator

Firefox communicates over d-bus to connect to an existing instance, right?

I think perhaps the right way to go is to forward that? Which IIUC will fix other things like some desktop integration too...

@WhatAmISupposedToPutHere
Copy link
Collaborator

Dbus forwarding would be nice to have, but it is more complicated than it looks (there is fd passing involved), and you would need to have a "dbus firewall", as we will want certain objects to be separate between host and guest. I would say it is a bit too much rn, and the solution above works.

Copy link
Collaborator

@slp slp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slp slp merged commit f464c62 into AsahiLinux:main Dec 9, 2024
2 checks passed
@shaoyanji
Copy link

i was wondering about this. i run a nix home-manager firefox-esr to port my stuff over and each build corrupts the profile.ini file. my fix: to add a pre and posthook to backup and replace to keep the previous profile.ini to just keep the native firefox to work. curious if this works for the firefox-esr

@hoshinolina
Copy link
Contributor Author

That sounds like a different issue, I think? It's not profile.ini that gets corrupted, it's the actual profile databases (the ones that go quickly are cookies and places (history)). This happens because the VM does not share locks with the host (yet), so the normal locking that Firefox does on the profile does not work. If you are running multiple Firefox instances without a filesystem or OS layer that makes locks not work across them, they should not be able to launch concurrently on the same profile.

The environment variable probably works for all versions of Firefox though, if you want to try it.

@Shados
Copy link

Shados commented Dec 29, 2024

and you would need to have a "dbus firewall", as we will want certain objects to be separate between host and guest

Worth noting that xdg-dbus-proxy does exist, motivated by similar goals within flatpak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants