Docker for Windows: is it possible to install a printer? - docker

I have a .NET application which generates some reports in PDF format and sends them to a printer.
The printer is a network printer which is available directly via IP (no print server).
Right now this application is hosted on a Windows Server-based machine which has this printer installed.
Is it possible to pack this application in a Docker container? Which base image should I use? How to install a network printer with the corresponding drivers in a Docker container?

Related

How can I use a USB/COM port inside of a VSCode development container?

From inside of a development container for VSCode (Debian Linux) I'd like to use a COM port for communication via an USB device connnected to the Windows host machine (via WSL2). How can I make the COM port available insie of the container?
EDIT:
For WSL2 there is no official support yet.
As of right now WSL 2 does not include serial support, or USB device support.
A corresponding feature request is tracked on GitHub.
July 2021: As of right now WSL 2 does not include serial support, or USB device support.
Update November 2021: the same FAQ states:
Skanda Hazarika reports:
You can now connect USB devices in Windows Subsystem for Linux under Windows 11
If you’re an active user of Windows Subsystem for Linux and want to access USB devices right from the Linux instance running under WSL, then you’ll be happy to know that there has been a significant progress in this front.
Thanks to Microsoft’s contributions to the open-source dorssel/usbipd-win project, you can now enjoy USB passthrough access in WSL.
It means end users can perform tasks like flashing Android devices under Windows Subsystem for Linux, which are otherwise not supported by the Linux subsystem.
The usbipd-win project is all about creating a solution for sharing locally connected USB devices to other machines, including Hyper-V guests and WSL2. However, the official WSL2 Linux kernel used to lack support for the USB/IP protocol, requiring users to build the kernel themselves.
Since WSL kernel version 5.10.60.1, the required parameters are configured out of the box, so no manual recompilation is needed.
Microsoft has also contributed a command line interface to the project to both enable a USB device for sharing on Windows and seamlessly attach it from within WSL.
So if you have:
migrated/upgraded to Windows 11
applied all WSL updates (through the Windows Store)
Then, your VSCode should be able to access mounted USB drives through WSL.

Cannot launch GUI program on Docker container on remote server

My working machine in the office is Ubuntu 18.04, and I have installed a Docker container in this machine. Everything works fine, and I can use Graphic User Interface (GUI) programs such as Firefox and PyCharm in the Docker container. When I works at home, I use my Windows 10 notebook, and in order to connect my working machine in the office, I use X2Go program. With this program, I can remotely connect the machine in my office with GUI. I can also run GUI programs remotely. However, when installed Docker container once again remotely, I cannot use GUI programs in the Docker container. The reason is because in order to let the Docker container access host machine's GUI, I use xhost + command. However, when running this command remotely, I received the following error:
# xhost: must be on local machine to enable or disable access control.
If I ignore this error message, I cannot launch any GUI programs on the Docker container. Any ideas? Thanks.
This article may help:
https://www.ibm.com/support/pages/remote-install-websphere-application-server-unix-host
In the article:
If the remote host is not authorized to connect, you can add it to the
list of authorized clients using the following command:
xhost +
xhost: must be on local machine to enable or disable access control.
This indicates that this command is only authorized from a local
console (For example, not within a telnet session).
Next, you must export the display so that GUI screens generated on the
remote host will be displayed on the local host. To do this, run the
following command on the remote host while logged in through the
telnet session from the local host:
export DISPLAY=
Also your Remote Desktop protocol could be an issue.
X2Go uses NX protocol with SSH for security.
NX protocol uses a caching technology which may be part of the the problem. Remote desktop technologies can vary the experience and may not work with docker GUI remotely.
I have had similar issues with remote desktop technologies (RDP, VNC etc) where some or all of the desktop experience is not visible.
I suggest to try a VNC (RFB protocol) software and see if that works. RDP is another solution.
Be aware VNC and RDP are not by default very secure unless you use a tunneling solution (VPN etc) and encryption. There are VNCs with built in encryption (via SSH) and RDP has security solutions also, but if you are accessing it from home to work you should make sure your security manager is aware of the technology you choose that works for you.

Run windows applications in ibm bluemix

My company has a local solution where there was a database server and application server running on dedicated windows server machine(delphi application server, firebirdsql database). Now a client wants to move its servers to cloud. Is it possible to move both database and application server into ibm bluemix as is without changing code. It runs on windows 64 bit OS. What are the options? Is it not recommended to run windows applications in bluemix?
Can it be done with ibm containers - is it possible to run windows in containers?
You could take a look at the Virtual Server (Virtual Machines) on Bluemix and use a custom image running Windows. As reported on Bluemix Virtual Servers docs:
A virtual server image is a file that includes a virtual disk with an
operating system installed on it.
You use a virtual server image to create a virtual server. You can use
an image that is provided by IBM, a customized virtual server image,
or a snapshot that you took of another virtual server.
Important: In Bluemix, you can upload virtual server images that are
supported by OpenStack and have qcow2 format only.
For more information, see Virtual server images.
You probably want to select the VM option with Windows OS which your application runs. So no change is required.

How to run a X Windows application in Codenvy Cloud IDE?

Copdenvy's shellinabox runner allows you to start a shell in the browser in which you can compile and run your code. This is fine for applications that are console based. Is it possible to run an X Windows application in the cloud and see the graphical window?
Setting the DISPLAY variable in the shell to that of your Linux workstation could work, though it relies on you being in control of the local network for things like NAT and firewall settings. The attraction of the cloud IDE is that you only need a browser and an https connection.
Can you ssh -X into the Docker container from an X capable source? Where would you find the URL? How would you manage the ssh keys?
If you look at the Java/Swing "VNC + Java 7" runner for example you'll see that you're able to run an application which is using X DISPLAY through VNC. Codenvy supplies a web based X Windows environment that you can access by clicking on the hyperlink that is shown underneath the Console window, to the left of the Timeout counter. You can then look at the Docker recipe used to start this sample.
SSH in the docker container could be managed in Codenvy 3.x if you install inside the VM the sshd daemon and export the ssh/22 port. In upcoming Codenvy SaaS 4.x ssh will be enabled without any configuration.

Windows 8 Remote display driver model

I'm trying to port the current XPDM Mirror Driver to Windows 8.
Microsoft disables Mirror Drivers completely under Windows 8, but on MSDN it says
A remote display driver model that is based on the mirror driver architecture can also run starting with Windows 8. For more information, see Remote Display Drivers.
and on the remote display drivers page, it says:
A remote display driver is based on the Windows 2000 Mirror Driver model and is used to render the desktop in a remote session.
However, I could find any more information for "remote display driver" on the website, except this and this link on MSDN. The only information I have is that it is based on Win2K mirror driver model, but I don't know what I should do to make it Windows 8 compatible.
I tried to port the XPDM mirror driver code base into Visual Studio 2012, and I used the same inf file. The code can compile and deploy successfully on Windows 8, but the display driver is not loaded by kernel.
The display driver is named accdrv.dll, and the miniport driver is mirror.sys. When debugging the kernel, only the mirror.sys is loaded.
Is there a place where I can find some information on "remote display drivers"? so I can continue the work on it?

Resources