LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 06-05-2021, 11:34 AM   #1
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Odd file creation with Visual Studio Code, VirtualBox, and Windows


Typical work arrangement: everyone gets Windows but all of our work happens on Linux. Visual Studio Code is our "standard" editor and when used with remote Linux systems via SSH, everything's great. Trying to use it to access a CentOS8 VM running under VirtualBox has not been possible (or I haven't discovered the correct incantations yet). A co-worker suggested setting up a shared Windows/VirtualBox folder (hosted on Win10) in order to edit code on the VM (where it runs during testing).

While editing through the Windows/VirtualBox works, I ran into a strange problem yesterday: When quick changes are made to files in the shared directory mount on the VM (using an editor on the VM), copies of the files appear in the directory that are prefixed with ".#". For example, while editing a file containing a set of variables to be read by an Ansible playbook:
Code:
$ cd <shared-folder>/vars
$ ls
included_data.vars
$ emacs included_data.vars
[make changes]
After a short time, what I see in that directory is:
Code:
$ ls
.#included_vars.yml  included_vars.yml  included_vars.yml~
When the Ansible script runs, it complains because it's finding the ".#" file first -- which either contained errors or was missing something (hence the need for the edit) -- and crashes the playbook. A suitable workaround is to include "ignore: '.#'" in the playbook. While that works, these files would still be clutter in the file menus making it harder to find real files to edit.

I never see this sort of file getting created when working with files on systems that I'm accessing via SSH.

Q: Any ideas as to which piece of this setup is creating the ".#" files? I suspected VS Code but I can find nothing in the settings that mentions anything about backup files. The VirtualBox settings also don't mention anything about creating and naming backup files like this. (I wouldn't even know where to begin trying to find out whether Win10 is creating these odd files.)

When these files are created, the only sure-fire means of removing them is from the Windows side of the setup. Neither "rm -f '.#filename'" nor the same command via sudo works (permissions). Right-click/Delete in VSCode and/or Win10's file manager will delete them. I can't recall (as I'm writing this) whether I was able to remove them via Emacs dired.

Another co-worker suggested running VSCode directly on the VM -- which would neatly remove the need for the Win10/VirtualBox connection -- but by the time VirtualBox's window title bar, menu/status bars, and then a similar number of title/menu/status bars from VSCode are displayed, there's precious little screen real estate left to do actual editing unless I make the editor typeface too small for my tired eyes.

TIA for any ideas as to where I can disable the creation of these files?
 
Old 06-05-2021, 12:03 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,714

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
The .#* files are interlocks to prevent the simultaneous editing of the same file.

https://www.emacswiki.org/emacs/AutoSave
 
Old 06-05-2021, 11:43 PM   #3
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Original Poster
Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by michaelk View Post
The .#* files are interlocks to prevent the simultaneous editing of the same file.

https://www.emacswiki.org/emacs/AutoSave
Thanks. Weird that all the time I've been using Emacs I hadn't noticed those lurking in the dired listings before. Using the shared directory was done in large part to allow testing under different VMs so dedicating only a single editor -- either on Win10 or on only one of the VMs -- will need to be the rule of the day. I'm not the only one doing the Windows/VM shared directories but I'm quite likely the only Emacs user---I'll have to get in touch with one of the Vi devotees to see if they've encountered anything like these files.

Later...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio Code, Microsoft's code editor for Linux wet1 General 5 04-24-2020 04:31 AM
Visual Studio + Visual Micro in Debian? hellvetica Linux - Software 5 04-04-2017 10:24 AM
Microsoft Visual Studio Code, A Free Cross-Platform Code Editor For OS X, Linux jeremy Linux - News 4 04-30-2015 09:15 AM
Stupid Question: Microsoft Visual Studio 6.0 (A.K.A. Visual Basic 6) Will it run? S0RD3N Linux - Software 8 05-07-2008 08:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 07:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration