2017-05-11 17:42:16 -04:00
---
layout: doc
2018-02-25 17:00:22 -05:00
title: How to Make a Multimedia TemplateVM
2018-02-18 17:28:51 -05:00
permalink: /doc/multimedia/
redirect_from:
- /en/doc/multimedia/
- /doc/Multimedia/
- /wiki/Multimedia/
2017-05-11 17:42:16 -04:00
---
2018-02-25 17:00:22 -05:00
How to Make a Multimedia TemplateVM
===================================
2018-02-21 01:30:52 -05:00
Note: This Howto has been written and was tested under Qubes 4rc4
2017-05-09 16:30:23 -04:00
2018-02-25 16:01:53 -05:00
You can consolidate most of your media streaming tasks into one "multimedia" App-VM. This howto explains how to create a multimedia template which can be used to play multimedia content.
2018-02-18 17:28:51 -05:00
This includes:
2017-05-09 16:30:23 -04:00
2018-02-18 17:28:51 -05:00
- Spotify
- Amazon Prime
- Netflix
- DVDs
2017-05-09 16:30:23 -04:00
2018-02-18 17:28:51 -05:00
Installation
------------
2017-05-09 16:30:23 -04:00
2018-02-18 17:28:51 -05:00
Start by cloning the default debian template in dom0.
Hint:
t-multimedia is just the template VM where we will install all packages.
In the last step we will create an AppVM from this template.
2017-05-11 17:28:00 -04:00
2018-02-18 17:28:51 -05:00
`qvm-clone debian-9 t-multimedia`
2017-05-09 16:30:23 -04:00
2018-02-18 17:28:51 -05:00
Launch a Terminal in the new template VM:
2017-05-09 16:30:23 -04:00
2018-02-18 17:28:51 -05:00
`qvm-run --auto t-multimedia gnome-terminal`
2017-05-09 16:30:23 -04:00
2018-02-18 17:28:51 -05:00
Important:
Enter all the following commands in the terminal of the template VM
2018-02-21 13:20:00 -05:00
Become the root user to run all following command without the need to use sudo in the multimedia template VM
2017-05-09 16:30:23 -04:00
2018-02-18 17:28:51 -05:00
`sudo -i`
2017-05-11 17:28:00 -04:00
2018-02-21 17:41:41 -05:00
This howto assumes that you have xclip available in the AppVM where you download the Repository Signing keys.
xclip will be used to paste the content of the clipboard to a file.
You can install xclip via:
`apt-get install xclip` on Debian
`dnf install xclip` on Fedora
You can of course install xclip just into the AppVM where you download the signing keys to have it available for this howto and it will be deleted if you reboot the AppVM. To have xclip available also after a reboot you need to install it in the Template VM on which your Internet AppVM is based (make sure to reboot the AppVM after you've installed any package in its template)
2018-02-21 13:20:00 -05:00
2018-02-18 17:28:51 -05:00
Installation of Spotify
-----------------------
2017-05-11 17:28:00 -04:00
2018-02-18 17:28:51 -05:00
Import GPG-Key for spotify
2018-02-21 13:20:00 -05:00
As the template VM can't connect to internet you need to get the public key file from another AppVM and copy it to the template VM. The easiest way is to use the Qubes Clipboard to copy the keys from the AppVM where you get the key to the Template VM.
In an AppVM which has Internet access:
2019-03-26 23:45:44 -04:00
- Open < https: // keyserver . ubuntu . com / pks / lookup ? op = get&search=0xA87FF9DF48BF1C90 >
2018-02-21 17:41:41 -05:00
- Copy content of page to the Clipboard (Ctrl+A and Ctrl+C)
- open a Terminal in this AppVM and copy the content of the clipboard to a file
`xclip -o > spotify.pubkey`
2018-02-21 13:20:00 -05:00
2018-02-21 18:14:27 -05:00
Copy the public signing key over to the multimedia template VM
- copy the file via `qvm-copy-to-vm t-multimedia spotify.pubkey`
- or create a new file on the Template VM and copy the content of the clipboard (the public key)
Copy content of page to the Qubes Clipboard (Ctrl+C and then Shift+Ctrl+C)
Switch to the gnome terminal in the Multimedia Template VM
`nano spotify.pubkey`
Paste the content from the Qubes Clipboard into nano (Shift+Ctrl+V and then Paste)
Save the file (Ctrl+O < Enter > Ctrl+X)
2018-02-25 16:01:53 -05:00
Check the signature of the signing key (in the multimedia Template VM).
Hint: depending on your installed version of GnuPG the command to show a public might slightly be different.
2018-02-25 16:55:45 -05:00
See [this StackExchange question ](https://unix.stackexchange.com/questions/391344/gnupg-command-to-show-key-info-from-file ) for more information.
2018-02-25 16:01:53 -05:00
If this command doesn't show a fingerprint choose one of the other commands mentioned in the above link.
2017-05-11 17:28:00 -04:00
2018-02-21 17:41:41 -05:00
`gpg --with-fingerprint spotify.pubkey`
2017-05-11 17:28:00 -04:00
2018-02-21 17:41:41 -05:00
This should look like:
2018-02-21 17:43:35 -05:00
2018-02-25 17:20:18 -05:00
[user@t-multimedia ~]$ `gpg --with-fingerprint spotify.pubkey`
2018-02-21 17:43:35 -05:00
2019-03-26 23:45:44 -04:00
pub 4096R/48BF1C90 2018-05-23 Spotify Public Repository Signing Key < tux @ spotify . com >
2018-02-25 17:20:18 -05:00
2019-03-26 23:45:44 -04:00
Key fingerprint = 931F F8E7 9F08 7613 4EDD BDCC A87F F9DF 48BF 1C90
2017-05-11 17:28:00 -04:00
2018-02-21 17:41:41 -05:00
You can (and should) lookup the fingerprint on at least one (or more) keyservers as the above information might be outdated.
2018-02-25 17:20:18 -05:00
2019-03-26 23:45:44 -04:00
< https: / / keyserver . ubuntu . com / pks / lookup ? op = vindex&search=0xA87FF9DF48BF1C90&fingerprint=on >
2018-02-21 15:42:35 -05:00
2018-02-21 17:41:41 -05:00
Add the public key to the repository keyring
`apt-key add spotify.pubkey`
2017-05-11 17:28:00 -04:00
2018-02-21 15:08:25 -05:00
Add the Spotify repository to your list of package sources:
2018-02-21 15:42:35 -05:00
2018-02-21 15:08:25 -05:00
`echo deb http://repository.spotify.com stable non-free > /etc/apt/sources.list.d/spotify.list`
2017-05-09 16:30:23 -04:00
2018-02-21 15:08:25 -05:00
Update the list of all known packages
2018-02-21 15:42:35 -05:00
2018-02-18 17:28:51 -05:00
`apt-get update`
2017-05-09 16:44:49 -04:00
2018-02-21 15:08:25 -05:00
Install Spotify
2018-02-18 17:28:51 -05:00
`apt-get install -y spotify-client`
2017-05-09 16:44:49 -04:00
2018-02-18 17:28:51 -05:00
Create a spotify desktop-entry
2017-05-09 16:44:49 -04:00
2018-02-18 17:28:51 -05:00
`cp -p /usr/share/spotify/spotify.desktop /usr/share/applications/`
2018-02-21 15:42:35 -05:00
2018-02-18 17:28:51 -05:00
`cp /usr/share/spotify/icons/spotify-linux-16.png /usr/share/icons/hicolor/16x16/apps/spotify.png`
2017-05-09 16:44:49 -04:00
2018-02-21 17:41:41 -05:00
2018-02-18 17:28:51 -05:00
Installation of VLC
-------------------
2017-05-09 16:44:49 -04:00
2018-02-18 17:28:51 -05:00
To play DVDs you can install VLC with the needed Codecs
2017-05-09 16:44:49 -04:00
2018-02-21 15:08:25 -05:00
Download the public key which signs the VLC package repositories
In an AppVM which has Internet access:
2018-02-25 17:20:18 -05:00
- Open < https: // keyserver . ubuntu . com / pks / lookup ? op = get&search=0x6BCA5E4DB84288D9 >
2018-02-21 17:41:41 -05:00
- Repeat all steps to save the public signing key on the AppVM (see above / Spotify example)
`xclip -o > videolan.pubkey`
2018-02-21 18:14:27 -05:00
Copy the public signing key over to the multimedia template VM
- copy the file via `qvm-copy-to-vm t-multimedia videolan.pubkey`
- or create a new file on the Template VM and copy the content of the clipboard (the public key)
Copy content of page to the Qubes Clipboard (Ctrl+C and then Shift+Ctrl+C)
Switch to the gnome terminal in the Multimedia Template VM
`nano videolan.pubkey`
Paste the content from the Qubes Clipboard into nano (Shift+Ctrl+V and then Paste)
Save the file (Ctrl+O < Enter > Ctrl+X)
Check the signature of the signing key
2018-02-21 17:41:41 -05:00
`gpg --with-fingerprint videolan.pubkey`
This should look like:
2018-02-21 17:43:35 -05:00
2018-02-25 17:20:18 -05:00
[user@t-multimedia ~]$ `gpg --with-fingerprint videolan.pubkey`
pub 2048R/B84288D9 2013-08-27 VideoLAN APT Signing Key < videolan @ videolan . org >
2018-02-21 17:43:35 -05:00
2018-02-25 17:20:18 -05:00
Key fingerprint = 8F08 45FE 77B1 6294 429A 7934 6BCA 5E4D B842 88D9
2018-02-21 17:43:35 -05:00
2018-02-25 17:20:18 -05:00
sub 2048R/288D4A2C 2013-08-27
2018-02-21 17:41:41 -05:00
You can (and should) lookup the fingerprint on at least one (or more) keyservers as the above information might be outdated.
2018-02-25 17:20:18 -05:00
< https: / / keyserver . ubuntu . com / pks / lookup ? op = vindex&search=0x6BCA5E4DB84288D9&fingerprint=on >
2018-02-21 17:41:41 -05:00
2018-02-21 15:08:25 -05:00
Add the public key to the repository keyring
2018-02-21 17:41:41 -05:00
`apt-key add videolan.pubkey`
2018-02-21 15:08:25 -05:00
Add the new VLC package repositories to your list of sources
2018-02-21 15:42:35 -05:00
2018-02-21 15:08:25 -05:00
`echo "deb http://download.videolan.org/pub/debian/stable/ /" > /etc/apt/sources.list.d/vlc.list`
2018-02-21 15:42:35 -05:00
2018-02-21 15:08:25 -05:00
`echo "deb-src http://download.videolan.org/pub/debian/stable/ /" >> /etc/apt/sources.list.d/vlc.list`
2018-02-18 17:28:51 -05:00
Update package repositories
2018-02-21 15:42:35 -05:00
2018-02-18 17:28:51 -05:00
`apt-get update`
Install libdvdcss and VLC
2018-02-21 15:42:35 -05:00
2018-02-21 15:08:25 -05:00
`apt-get install -y libdvdcss2 vlc`
2018-02-18 17:28:51 -05:00
2018-02-21 17:41:41 -05:00
2018-02-18 17:28:51 -05:00
Installation Google Chrome
--------------------------
To play Videos with Netflix, Amazon Prime & Co using Chrome is a good option as it has all needed codecs included.
Hint: Using Chromium will not work for some reasons.
2018-02-21 15:08:25 -05:00
Download the public key which signs the Google package repositories
In an AppVM which has Internet access:
2018-02-25 17:20:18 -05:00
- Open < https: // keyserver . ubuntu . com / pks / lookup ? op = get&search=0x7721F63BD38B4796 >
2018-02-21 17:41:41 -05:00
- Repeat all steps to save the public signing key on the AppVM (see above / Spotify example)
`xclip -o > google.pubkey`
2018-02-18 17:28:51 -05:00
2018-02-21 18:14:27 -05:00
Copy the public signing key over to the multimedia template VM
- copy the file via `qvm-copy-to-vm t-multimedia google.pubkey`
- or create a new file on the Template VM and copy the content of the clipboard (the public key)
Copy content of page to the Qubes Clipboard (Ctrl+C and then Shift+Ctrl+C)
Switch to the gnome terminal in the Multimedia Template VM
`nano google.pubkey`
Paste the content from the Qubes Clipboard into nano (Shift+Ctrl+V and then Paste)
Save the file (Ctrl+O < Enter > Ctrl+X)
2018-02-21 17:41:41 -05:00
Check the signature of the signing key (still in the AppVM where you downloaded the key)
2018-02-18 17:28:51 -05:00
2018-02-21 17:41:41 -05:00
`gpg --with-fingerprint google.pubkey`
2018-02-18 17:28:51 -05:00
2018-02-21 17:41:41 -05:00
This should look like:
2018-02-21 17:43:35 -05:00
2018-02-25 17:20:18 -05:00
[user@t-multimedia ~]$ `gpg --with-fingerprint google.pubkey`
pub 4096R/D38B4796 2016-04-12 Google Inc. (Linux Packages Signing Authority)
2018-02-21 17:43:35 -05:00
2018-02-25 17:20:18 -05:00
< linux-packages-keymaster @ google . com >
2018-02-21 17:43:35 -05:00
2018-02-25 17:20:18 -05:00
Key fingerprint = EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796
2018-02-21 17:43:35 -05:00
2018-02-25 17:20:18 -05:00
sub 4096R/640DB551 2016-04-12 [expires: 2019-04-12]
2018-02-21 17:43:35 -05:00
2018-02-25 17:20:18 -05:00
sub 4096R/997C215E 2017-01-24 [expires: 2020-01-24]
2018-02-18 17:28:51 -05:00
2018-02-21 17:41:41 -05:00
You can (and should) lookup the fingerprint on at least one (or more) keyservers as the above information might be outdated.
2018-02-25 17:20:18 -05:00
< https: / / keyserver . ubuntu . com / pks / lookup ? op = vindex&search=0x7721F63BD38B4796&fingerprint=on >
or
< https: / / www . google . com / linuxrepositories / >
2018-02-18 17:28:51 -05:00
2018-02-21 17:41:41 -05:00
Add the public key to the repository keyring
2018-02-21 15:42:35 -05:00
2018-02-21 17:41:41 -05:00
`apt-key add google.pubkey`
2018-02-18 17:28:51 -05:00
2018-02-21 15:08:25 -05:00
Add the Google package repositories to your list of sources
2018-02-24 18:45:59 -05:00
`echo "deb http://dl.google.com/linux/chrome/deb/ stable main"> /etc/apt/sources.list.d/google.list`
2018-02-18 17:28:51 -05:00
2018-02-21 15:08:25 -05:00
Update package repositories
2018-02-21 15:42:35 -05:00
2018-02-21 15:08:25 -05:00
`apt-get update`
2018-02-18 17:28:51 -05:00
2018-02-21 15:08:25 -05:00
Install Chrome
2018-02-21 15:42:35 -05:00
2018-02-21 15:08:25 -05:00
`apt-get install google-chrome-stable`
2018-02-18 17:28:51 -05:00
2018-02-21 17:41:41 -05:00
2018-02-21 15:42:35 -05:00
Create a Multimedia AppVM
-------------------------
2018-02-21 17:41:41 -05:00
2018-02-21 15:42:35 -05:00
The last step is to create a multimedia AppVM (named "my-multimedia" here) based on the new multimedia template.
2018-02-18 17:28:51 -05:00
2018-02-24 18:45:59 -05:00
`qvm-create --template t-multimedia --label orange my-multimedia`
2018-02-25 17:20:18 -05:00