Can I keep vscode Terminal connected to host machine while in Docker environment using Remote Containers extension? - vscode-remote

I have the Remote Containers extension setup so I can jump into a docker container for autocomplete etc. That's working how I want it to.
But it also sets the Terminal window to be inside that environment and I want to instead keep the Terminal window connected to my host machine. I can understand why it's useful to have Terminal from inside the container, but it's not useful for my usecase and it breaks some of my testing tools.

There are 2 commands in VS Code to open terminal windows when using Remote Containers extension:
Terminal: Create New Integrated Terminal will open a terminal window within a container.
Terminal: Create New Integrated Terminal (Local) will open a terminal on your host machine.
Latter doesn't seem to have have a key binding assigned, so you may want to add one.

Related

How to (semi-)automatically sync local files with remote devcontainer?

My Goal
I've been using devcontainers in combination with WSL2 for a little while now. But I keep running into issues and besides that I like off-loading resources of my laptop to a server. Moving the containers to a native Linux server would solve my issues.
My ideal situation would be to have a solution that works just like working locally on my Windows laptop (later probably moving to Macbook) but using the facilities of a Linux server (which has systemd and netns) and moving the workload there as well so my laptop doesn't sound like a vacuum cleaner.
My Journey
I'm trying to setup remote containers as described here: https://code.visualstudio.com/remote/advancedcontainers/develop-remote-host
Actually the containers are running fine, I'm using the second storage solution what means I add the following to my .devcontainer.json:
"workspaceMount": "source=/home/marvink/code,target=/workspaces,type=bind,consistency=cached"
And my workflow currently looks something like this:
Clone project locally (with .devcontainer already in the project)
Add workspaceMount above to devcontainer.json
Clone project on remote (e.g. to /home/marvink/code/new-project)
Open project locally
Build and reopen in container
Work on the files on the remote
My issue
This works but now I have files on my local drive that never get touched which isn't ideal but not a disaster, the bigger issue is when I want to update the devcontainer. I need to do that locally (in a seperate window), manually need to copy paste that to the remote if I want to commit it to git and off-course I sometimes forget this and try to edit it remotely which is causing a lot of frustration (and sometimes it seems like it does use the remote config, but that might have been a mistake?).
This is why I want to setup rsync both ways to sync changes to files and as a bonus I can edit files locally when I'm offline. In the link it's described how to do it manually but I want it automated so that I can't forget or make mistakes.
From Powershell I'm able to run an rsync command that syncs one-way and I can extend that to sync 2-way:
wsl rsync -rlptzv --progress --exclude=.git '$PWD' 'marvink#s-dev01:~/code/new-project'
This needs to be ran locally but I can't find a way to do that. I'd need to run a task locally for example, but that isn't possibly when working on a remote (https://github.com/microsoft/vscode-remote-release/issues/168).
The other way around doesn't seem like an option to me as I don't want to expose any ports on my laptop and firewalls would get in the way depending on where I am.
My question
My workflow still seems a bit convoluted so I'm open to suggestions on that end but any ideas on how to sync my workspace files?
You don't need a local version of your code (containing the .devcontainer folder) if you're storing that code on the remote server. You should be able to open an ssh target in VScode using the Remote - SSH extension, which is the recommended approach in the link you added. The extension Remote - Containers 'stacks' on top of the SSH extension, so once connected over SSH you then connect to the container using the .devcontainer.json configuration located on your remote server.
If you don't want to use the extension and use a bind mount + specify docker.host in your settings.json file, you can sync code using the approaches in that same article, through SSHFS, docker machine, or rsync.

Cmder/Conemu: dynamically name tab title from within task definition

I am using Putty in Cmder to ssh to a 'jumpbox'. I then pass a hostname in a file using the -m ssh option to jump to the 'real' destination host.
I want to dynamically set the title of the putty tab from within a task definition in Cmder/ConEmu to be the hostname I'm jumping to. In the screenshot below you can see that I have attempted to use "%REMOTE_HOST%" to pass in an environment variable containing the title that I want to have on my tab. However this just creates a tab named %REMOTE_HOST%.
Any help would be greatly appreciated.
I explained many times that PuTTY and mintty are not console applications, they are GUI applications with their own graphical interface.
An analogy: you run VirtualBox with Ubuntu (as client) in Windows (as host) and some console application in you VirtualBox-ed Ubuntu. Don't you wonder why TaskBar in Windows does not show the title of Ubuntu console?
When you run ChildGUI in ConEmu it shows in the Tab children window title.
What you need to do
Configure PuTTY or your remote host (e.g. bash prompt with ANSI) to show proper text in PuTTY title. The questsion has nothing to do with ConEmu.
Also, ensure that the tab bar console template in ConEmu/Cmder settings is or contains %s. e.g.

RemoteWebDriver launches browsers in background when started remotely using cygwin and openssh

I am trying to run automation tests remotely on a windows machine using from Unix box. I am using cygwin and openssh for it.
I am able to run the tests and take screenshots. However, the browsers launch and run in the background.
I cannot change the property of the CYGWIN SSHD service to "Allow interaction with desktop" because I cannot use the Local system account.
Is there any other way to be able to view the UI in the remote window machine while execution is going on?

Findmerge graphical using paramiko

I have a script on a remote clearcase server which I execute using paramiko invoke_shell.The script contains a cleartool findmerge command graphical but the graphical window never opens though I used x11 forwarding. It waits forever.I even added the checkout comments for the merge. I want the graphical window to be opened.
It depends how you did setup your X-forwarding: see this thread for example:
Launch Exceed
Launch Putty
In the putty configuration window, select Connection, then SSH, and then X11 from the left side menus.
On the right side, select the checkbox for Enable X11 forwarding and set the X display location to "localhost:0" .
In the putty configuration window, select Session from the left side.
Enter the hostname of a system to connect to Select the SSH protocol
Save settings by selecting the Save button on the right.
Invoke session by double-clicking on hostname
from the server, run "export DISPLAY=windows ip:0"
You should be able to run any X-based tool or application
e.g. clearprojexp &
The OP Srikar Veeramallu mentions in the comments:
I am in a dynamic view set using cleartool setview
That explains why it "waits forever". A setview will create a sub-shell, which might not benefit from the same X11 forwarding as the main shell.
See "Python and ClearCase setview" for more details.
The workaround is to use the full path of the view.

WPF app won't run in kiosk mode

I have a WPF application that is designed for a touchscreen kiosk. Users will not have access to a keyboard or mouse. The application runs fine when started normally from the program icon in windows. However, when it is set up to run automatically at startup (by replacing the Windows shell using a registry key), the application does not function properly.
The application reads an XML file that lists available videos, then displays buttons to show the videos. When run in "kiosk mode," it does not seem to have access to the files in its media directory (the XML file and presumably the videos as well). I suspect that because the application is running in place of the windows explorer, it is missing resources it needs for file access that are normally loaded by windows explorer.
I have not been able to find any info on this - there is plenty of info on how to get an app to run at startup, but not much on how to make sure it will actually function in that environment. The PC is running Windows 7 Professional.
Is my assumption about the problem correct, or is it likely something else (e.g. permissions - we checked the permissions, but maybe they operate differently when you replace the windows shell?) If it is because needed resources are not loaded, does anyone have pointers on how to make sure my app loads them?
Perhaps you have file access occurring via a file dialog? This might explain a bit further. What is the minimum functionality needed to create Shell Replacement for Windows?
because you have stopped windows default running explorer.exe , your program can not get access to default xml directory therefore you should specify the complete path for example like below:
stream = File.Open(#"C:\x86\Debug\xml.xml", FileMode.OpenOrCreate);

Resources