Anyone gotten bitcoind to install via snapcraft on an AppVM?

17 views
Skip to first unread message

tetra...@danwin1210.me

unread,
Feb 27, 2020, 10:19:07 AM2/27/20
to qubes...@googlegroups.com
Current best solution for running bitcoind on an AppVM:
Download the binaries, run bitcoind as `user`

Disadvantages:
- bitcoind runs as the main VM user, no isolation
- no automatic updates of bitcoind
- no systemd service file, have to hack something together with
`rc.local` to get bitcoind to start on VM boot

Nicer approach:
install bitcoind via the Snapcraft Store, so we have systemd
integration, automatic updates, bitcoind running as a separate user

Attempted implementation steps:
- on debian-10 template, `sudo apt install -y snapd qubes-snapd-helper`
- reboot template and appVM
- on VM run `sudo snapd install bitcoin-core`
- reboot VM

Result:
- bitcoind does not appear as a service, `bitcoind` at the command line
produces file-not-foud

Additionally, trying to manually create a `bitcoind` user doesn't work.
After linking /etc/passwd, group, gshadow, passwd-, shadow, subgid,
subuid into bind-dirs using /rw/config/qubes-bind-dirs.d/50_user.conf,
`sudo adduser` produces the error:

$ sudo adduser bitcoind
Adding user `bitcoind' ...
Adding new group `bitcoind' (1001) ...
groupadd: failure while writing changes to /etc/group
adduser: `/sbin/groupadd -g 1001 bitcoind' returned error code 10. Exiting


tetra...@danwin1210.me

unread,
Mar 3, 2020, 3:52:17 AM3/3/20
to qubes...@googlegroups.com
On Thu, Feb 27, 2020 at 03:18:30PM +0000, tetrahedra via qubes-users wrote:
>Current best solution for running bitcoind on an AppVM:
>Download the binaries, run bitcoind as `user`

For future reference, the current Bitcoin-on-Qubes howtos appear to be
here:
https://github.com/qubenix/qubes-whonix-bitcoin

Comments for qubenix:
- Some systems have limited disk space (e.g SSDs) so it may make sense
to run a pruned node
- it would be really nice to use bind-dirs to avoid creating a second
Whonix WS templateVM (which takes up lots of disk space) --
unfortunately I haven't figured out how to create a new user and keep
that user persistent (see prior email)

qubenix

unread,
Mar 3, 2020, 6:18:55 AM3/3/20
to tetra...@danwin1210.me, qubes...@googlegroups.com
tetrahedra via qubes-users:
> On Thu, Feb 27, 2020 at 03:18:30PM +0000, tetrahedra via qubes-users wrote:
>> Current best solution for running bitcoind on an AppVM:
>> Download the binaries, run bitcoind as `user`
>
> For future reference, the current Bitcoin-on-Qubes howtos appear to be
> here:
> https://github.com/qubenix/qubes-whonix-bitcoin
>
> Comments for qubenix:
> - Some systems have limited disk space (e.g SSDs) so it may make sense  
> to run a pruned node

That's true, but using a pruned bitcoind will limit its usefulness as a
backend for other software (eg. electrum servers, block explorers). You
may be able to use it for a specific purpose (eg. joinmarket), but the
point of my guides is that you can keep adding new software that comes
out (eg. btcpayserver, lnd, c-lightning, esplora) and connect it to your
bitcoind VM without having to reindex the chain.

> - it would be really nice to use bind-dirs to avoid creating a second  
> Whonix WS templateVM (which takes up lots of disk space) --  
> unfortunately I haven't figured out how to create a new user and keep  
> that user persistent (see prior email)
>

This is a good point. Unfortunately I don't have a lot of extra
time/motivation currently to make sweeping changes like that. That's why
my btcpayserver branch hasn't been worked on since November.

It's nice to know that someone somewhere is paying attention to work
I've done with these. Thank you for that.

--
qubenix

CODE PGP: FE7454228594B4DDD034CE73A95D4D197E922B20
EMAIL PGP: 96096E4CA0870F1C5BAF7DD909D159E1241F9C54
IRC OTR: DFD1DA35 D74E775B 3E3DADB1 226282EE FB711765

tetra...@danwin1210.me

unread,
Mar 5, 2020, 8:15:34 AM3/5/20
to qubenix, qubes...@googlegroups.com
On Tue, Mar 03, 2020 at 11:17:53AM +0000, qubenix wrote:
>That's true, but using a pruned bitcoind will limit its usefulness as a
>backend for other software (eg. electrum servers, block explorers). You
>may be able to use it for a specific purpose (eg. joinmarket), but the
>point of my guides is that you can keep adding new software that comes
>out (eg. btcpayserver, lnd, c-lightning, esplora) and connect it to your
>bitcoind VM without having to reindex the chain.

Makes sense.

>> - it would be really nice to use bind-dirs to avoid creating a second
>>  
>> Whonix WS templateVM (which takes up lots of disk space) --  
>> unfortunately I haven't figured out how to create a new user and keep  
>> that user persistent (see prior email)
>>
>
>This is a good point. Unfortunately I don't have a lot of extra
>time/motivation currently to make sweeping changes like that. That's why
>my btcpayserver branch hasn't been worked on since November.

Yes, I tried to do it (see earlier email in this thread) but it's not
quite trivial. Bind-dir'ing /etc/passwd and related files seemed to
break `adduser`.

>It's nice to know that someone somewhere is paying attention to work
>I've done with these. Thank you for that.

Thank you for doing them!
Reply all
Reply to author
Forward
0 new messages