I want to be able to automatically restore login information when starting a disposable VM

I always watch youtube and niconico live broadcast with Firefox on a disposable VM, but is it possible to restore only the login information when the VM starts? ublockOrijin would probably have to be added manually, so I’ll put this in when I start it each time by myself. I’m thinking of adding this when I start up each time by myself.

You can do it automatically:

You can try to do this with Cookie Quick Manager, export youtube/google cookies from the firefox where you’re logged in youtube, copy them to DVM template and then import them in disposable after each start:

It could be possible to do it automatically in policies.json by configuring Cookie Quick Manager settings as well, but it needs to be tested.

It works like this for uBlock:

I guess you need to export Cookie Quick Manager config and add it in adminSettings after using this converter on the exported json config:
http://raymondhill.net/ublock/adminSetting.html

1 Like

An easier way is configuring the DVM template by running Firefox in it and logging into your account there. Also install any necessary addons.

2 Likes

Thanks. I am running it on the reference URL,

curl --proxy http://127.0.0.1:8082 -L https://raw.githubusercontent.com/arkenfox/user.js/master/user.js -o/home/user/user.js

it returns Recieved HTTP code 500 from proxy after CONNECT. Do I need to configure the DNS settings in the template or in the dom0 to make it work?

Thank you. This method looks easy and good, I will try it when apparantus’ method doesn’t work.

Are you running this directly in your template and not in disposable VM as specified in the guide?
Try to download the file from disposable VM or some AppVM and then transfer the file to your template.
But your command should work as well in template (at least it works for me). Maybe it’s just a problem with DNS server on your side.

1 Like

Sorry for the late reply. Yes, I am running it in the template, but it is returning a 500 error. So I’m using another VM that you told me about and then copying user.js to /home/user/ in the template and proceeding.

I am moving on to the next step, but I am getting tripped up.

export firefox_cfg=“/usr/lib/firefox-esr/firefox.cfg”
export user_js=“/home/user/user.js” > echo “// IMPORTANT: Start your code on the 2nd line” > firefox_cfg
cat $user_js | grep “user_pref” | grep -v “// user_pref” >> $firefox_cfg
sed -i ‘s/user_pref/pref/g’ $firefox_cfg

Of this,

echo “// IMPORTANT: Start your code on the 2nd line” > $firefox_cfg
I execute this line, get a permission not granted. I also tried running it with sudo, but got the same error: ‘bash: /usr/lib/firefox-esr/firefox.cfg: no permissions’
and could not proceed.

[root@deb-11-firefox ~] echo "// IMPORTANT: Start your code on the 2nd line" > $firefox_cfg

As specified by root@deb-11-firefox, you need to run these command as root.
Switch to root with this command:
sudo su
And run them there.

Thanks.

sudo su

I tried the same command after becoming root with This time I did not get the same error, but I was pointed out that it is an ambiguous redirect.

Can you post the exact error that you’ve got and the command that you’ve tried to run that generated this error?

echo “// IMPORTANT: Start your code on the 2nd line” > $firefox_cfg

This is my typed command.

Did you run the commands from the start?

export firefox_cfg ...

I was running it halfway through and had typed the continuation, but when I typed it from the beginning it succeeded and I was able to proceed to the end! The policy is for the time being a copy of the one published in the topic. However, when I restart the disposable APPVM, named YN2 (Youtube Niconico 2), this time the DNS settings revert to defaults from 1.1.1.1 and 1.0.0.1, and the net connection is not made, or ublockOrigin etc. is not installed. It seems that there is no ublockOrigin etc. installed.

For the time being, I would like to sleep today and work on it again tomorrow.

How did you configure your DNS settings?

The default 10.139.1.1/2 did not work, so it was changed to 1.1.1.1/1.0.0.1 to restore net communication After restarting YN2, it was again at 10.139.1.1/2, so manually,

sudo nano /etc/resolv.conf

to restore it back to its original state.

Changes in /etc/resolv.conf won’t persist in AppVM.
You can make the change in /etc/resolv.conf using bind-dirs in disposable template:

Thanks, the Default-DVM is debian11, but for verification purposes I created a new disposable VM and set the template to debian11 (Dafault-dvm). The policies I had set in the template were applied, and when I set 1.1.1.1/1.0.0.1 before boot, they were properly reflected and uBlockOrijin and NoScript were immediately installed. Good.

The other thing is the persistence of the settings in /etc/resolv.conf, but even if it is written in the disposable VM, it has disappeared when rebooting. I had created the directory and file respectively with mkdir and touch as per the procedure, and edited them with sudo nano like this.

bind+=( ‘/etc/resolv.conf’)

After all, when I restart the disposable VM, the DNS is back to normal and the 50_user.conf file has disappeared.

You need to make changes in disposable template (e.g. debian-11-dvm), not in disposable VM (dispX).

Hmm, my dafault-dvm is debian11 and both are listed in TEMPLETE, so I did the same for both.

bind+=( ‘/etc/resolv.conf’)
and the nameserver setting has not changed after restarting both templates. In that state, I shut down one of them >> started the disposable VM created from the template, and checked /etc/resolv.conf, but there seems to be no change with the default.