Proxmox-for-Channels: Step-by-Step for Creating a Chrome-Capture-for-Channels (cc4c) LXC Container

I've tried, as have others, to get the Docker version of Chrome-Capture-for-Channels working better. Although, a few have reported acceptable results, most have not. Being able to containerize it, has appeal though -- so, I thought I would take a shot at installing cc4c directly in a Proxmox LXC container.

It appears to work well, so I thought I'd document the steps for creating a cc4c LXC here:

Stepping through the usual series of windows for creating a new LXC, here are the values I used:

Debian 11 (Bullseye) is the choice here, as that's the same Linux base as the Docker container:

8GB should be adequate for disk space, though 16GB is nice if you have the space available:

Cores are important here, with 8 being a nice generous number if you have the vCPUs (which are OK to over allocate). 6 would probably be fine too -- below that I wouldn't recommend:

4096 is generous, 2048 should be fine too. Keep in mind you're running Chrome:

vmbr1 is my 10GbE bridge, so I'm using that. No firewall, and DHCP on IPv4, but use whatever is typical for you:

I'm passing through my iGPU (which can be shared with other LXCs), using the Proxmox 8 method:

And then, here's what needs to be done from the new LXC's Console. These steps are essentially duplicating what's done in the cc4c Dockerfile:

# Update and upgrade the container's OS
apt update

apt upgrade

# Install some basic system packages
apt install curl gnupg git

# Add the Node 18 repo via script and install nodejs
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -

apt install nodejs

# Install needed system libraries and utilities
apt install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils x11vnc x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable x11-apps xvfb xserver-xorg-core x11-xserver-utils xauth

# Add the Chrome signing key and install Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -

echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list

apt update

apt install google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends

# Clone the cc4c repo and install it
cd /opt

git clone https://github.com/fancybits/chrome-capture-for-channels

cd chrome-capture-for-channels

npm install # There will be some warnings here about vulnerabilities that can be safely ignored

# Add required environment variables needed by cc4c and Chrome
echo -e "DISPLAY=:99\nCHROME_BIN=/usr/bin/google-chrome\nDOCKER=true\nLIBGL_ALWAYS_INDIRECT=1\nLIBVA_DRIVER_NAME=iHD" | tee /etc/environment > /dev/null

# Exit followed by a fresh login to pick up the new env vars
exit

At this point you'll be logged out of the LXC's Console, so log back in, and switch to the /opt/chrome-capture-for-channels directory:

cd /opt/chrome-capture-for-channels

The last step will run Xvbf, a VNC server and cc4c itself:

Xvfb :99 -screen 0 1920x1080x16 & x11vnc -quiet -nopw -display :99 -forever & node main.js

cc4c is now running in the foreground, with the other two running in the background, and you should see something like this on your Console:

[1] 16268
[2] 16269
Xlib:  extension "DPMS" missing on display ":99".

The VNC desktop is:      cc4c2:0
PORT=5900
[2025/02/08 09:09:32.750] Chrome Capture server listening on port 5589

If you kill the foreground cc4c process for any reason. Be sure to kill the two background processes as well. Their PIDs are shown as [1] and [2] at this stage, or you can get them with a ps -ef command.

When you setup your CDVR Custom Channels Source, be sure to include chrome://gpu as a channel so you can check Chrome's stats regarding GPU use:

#EXTM3U

#EXTINF:-1 channel-id="weatherscan",Weatherscan
chrome://cc4c:5589/stream?url=https://v2.weatherscan.net/

#EXTINF:-1 channel-id="chrome.gpu",Chrome GPU
chrome://cc4c:5589/stream?url=chrome://gpu

Use the cc4c hostname in the above M3U if it resolves on your LAN, or substitute the IP address of the LXC container.

Use a VNC client to connect to the container, when a cc4c stream is active, if you need to login to a streaming service, or to go fullscreen. Logins and fullscreen player settings should be maintained by Chrome just like when you're using Chrome locally.

I'll add a script that'll autorun at container start, once I put this into production, and I'll update this step-by-step accordingly.

2 Likes

As usual, your contributions are greatly appreciated!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.