Skip to content

About

Automated RVTools file sent by email using Wine, Alpine Linux and Docker

Topics

Resources

Stars

2 stars

Watchers

3 watching

Forks

Repository files navigation

RVTools mailer on Wine - Docker image

This project sends RVTools file exported from your VMware infrastructure by email using Wine and Docker

Screenshot

Features

  • Sends .xlsx file exported from RVTools to a mail address of your choice
  • Only needs Docker to work, everything else is automated!
  • Super lightweight by running on Alpine Linux! (complete image size is less than 570 MB compared to Ubuntu with 5 GB!)
  • TO DO: Push the image to Docker Hub and/or GitHub
  • TO DO: If possible, reduce image size even more to below 500 MB
  • More coming soon...

Installation

Important

We recommend using Ubuntu to build the image (tested with Ubuntu 24.04 LTS), might work with other Linux distros too.

Warning

Building is not working on macOS Sequoia (15.1.1) using Docker Desktop (4.36.0) by adding FROM --platform=linux/386 i386/alpine:3.20 AS base to Dockerfile.

In my case, it crashed while installing .NET with a Segmentation fault from QEMU (issue with x86 emulation on arm64).

Please make sure you have the following prerequisites:

Show details for RVTools
Name: RVTools 4.2.2
File name: RVTools4.2.2.msi
File Size: 6.7 MB
SHA-256 Checksum: bb947325f9b58b715bcb5dd761ec8156b01d0fa07f4a0baeefa0ed75779bdc41
Published: 2021-12-29

Downloading the source code

Clone the repository:

git clone https://github.com/canalplustelecom/rvtools-wine.git
cd rvtools-wine

To update the source code to the latest commit, run the following command inside the rvtools-wine directory:

git pull

Usage

  • Add the installer file RVTools4.2.2.msi inside project's folder.

  • Create a copy of .env.sh.template to .env.sh and modify the file so the variables match with your environment:

cp .env.sh.template .env.sh
vi .env.sh
  • Create a copy of .message.txt.template to .message.txt and modify the file with the message you want to send (supports environment variables):
cp .message.txt.template .message.txt
vi .message.txt
  • If you have Docker installed you just have to type the following commands and wait approximately 15 minutes for the program to run completely (after building the image).
# Build Docker image
docker build -t cpt/rvtools-wine .
# Run the image inside a container
docker run -d --rm cpt/rvtools-wine

Example

A typical usage could be to run the command above each week with crontab:

# Edit your cron tasks
crontab -e
# Add the project's command to this file and whatever else you want
54 1 * * 2 docker run -d --rm cpt/rvtools-wine >> /var/log/rvtools-wine.log 2>&1
@weekly date >> /var/log/beforereboot.log && /sbin/shutdown -r +5

Troubleshooting

The following command can help you troubleshoot the image (you also have to modify rvt-gen-script.sh to strip xvfb-run so RVTools window shows on your display and add WINEDEBUG=+relay to show verbose output, like this: WINEDEBUG=+relay WINEPREFIX=/ wineboot):

docker run --net host -e DISPLAY=${DISPLAY} --rm -it -v /tmp/.X11-unix:/tmp/.X11-unix:rw -v /tmp/.env.sh:/.env.sh -v /tmp/.message.txt:/.message.txt -v /tmp/rvt-gen.sh:/rvt-gen.sh --entrypoint /bin/sh cpt/rvtools-wine

If needed, you can find the tested Alpine Linux packages versions in installed.txt file used during the latest release of the project.

Non-exhaustive list of errors you can safely ignore in console:

log4net:ERROR Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the <log4net> and <configSections> elements. The configuration section should look like: <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />

And:

X connection to :99 broken (explicit kill or server shutdown).

Authors & Credit

About

Automated RVTools file sent by email using Wine, Alpine Linux and Docker

Topics

Resources

Stars

2 stars

Watchers

3 watching

Forks

Contributors

Languages