Score:2

How do i run multiple instances of Viber on a same computer Ubuntu Mate

kz flag

Did anyone know how to run 2 or more times of Viber on the same machine, so i can use 2 numbers at the same time?

i try with

mkdir ~/.viber2ndprofile    
viber -many -workdir ~/.viber2ndprofile 

but it did not work

vanadium avatar
cn flag
Official way: make a second account, configure different number there, switch accounts. This is running multiple instances on same computer. Probably not what you are looking for, so better elaborate your question to indicate more specifically what you are looking for. Perhaps with firejail, something could be set up.
N0rbert avatar
zw flag
Telegram and Viber are different apps, is not they?
Philip Scot avatar
kz flag
@vanadium I would like to both numbers at the same time on only one of the users, without switching between them. It is like to to have two firefox tabs open on two separete windows on your desktop.
Philip Scot avatar
kz flag
@N0rbert Yea they are. I found a post where someone manage to run telegram the way i want to run viber. So i copy and try the code. When i paste it here i forgot to change the telegram part. It is already fixed tho.
Score:0
in flag

This procedure will use account switching, but only once during setup. Use of Viber will be possible then without switching GUI sessions, but only with su command in terminal.

I assume that Viber for primary user (user1 for instance) is installed and running OK.

  • Create another user. Go to Settings -> Users -> Add User. Choose name user2 for instance. Switch login to this user and run Viber, register Viber for another phone number. Uncheck "Launch Viber in background", for convinience.

  • Logout from user2 and switch back to user1.

  • Now, in terminal, as user1, create script viber2.sh with the following commands:

    # Allow user2 connect to X server:
    xhost +SI:localuser:user2
    # or simply run xhost +, if you do not care about security.
    
    # Run the second Viber instance:
    sudo su user2 -c "/opt/viber/Viber"
    
  • Execute script and window with second Viber will appear.

This procedure works for me on Ubuntu 20.04 with Gnome, but I believe with Mate it will be OK too.

You may see error message from script: XDG_RUNTIME_DIR not set in the environment. Just ignore it unless you badly need to use sound in second Viber instance and ready to setup pulseaudio in insecure way by running pulse with '--system' setting. (Sound for user1's Viber should work fine.)

Note, there are some nuances exiting second Viber instance: if you simply close Viber window, process will still be running. Only Ctrl+C in terminal will actually kill the process. I haven't found better solution for this (yet).

To avoid entering password each time executing script, add this line:

   user1     ALL=(ALL:ALL) NOPASSWD: /usr/bin/su user2 -c /opt/viber/Viber

to sudoers:

   visudo /etc/sudoers.d/viber2_sudoers
 
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.