DOSBox on Windows 10- How to mount a network location? - dosbox

I am trying to use DOSBox to mount a folder on a different machine, both running Windows 10.
I've tried mounting //PC-NAME/filename as it displays in Windows Explorer, but it doesn't work.
Mounting shortcuts doesn't work either. Is this possible to do?

On the console there exists the command net use for such cases.
In DOSbox the mount command is used instead. Examples:
mount c c:\temp
mount n //Snoopy/temp/
For network shares seems it is critical to have that additional / at the end. These mount commands can be also placed in your dosbox-0.74.conf file located in C:\Users\<UserId>\AppData\Local\DOSBox and you'll have C: and N: drives available from the start.
This works for me running DOSbox 0.74 on Win7 64-bit.

Got it! You can't mount the first directory. You have to use a subdirectory:
//PC-NAME/filename/subdirectory

Related

Invalid mount config for type "bind": bind source path does not exist when trying to run container on Docker for Windows

I'm trying to run the Prometheus sample at https://docs.docker.com/engine/admin/prometheus/#use-prometheus using Docker on Windows. I'm executing the following command:
docker service create --replicas 1 --name my-prometheus `
--mount type=bind,source="C:/temp/prometheus.yml",destination=/etc/prometheus/prometheus.yml `
--publish published=9090,target=9090,protocol=tcp `
prom/prometheus
The error is: invalid mount config for type "bind": bind source path does not exist
I'm pretty certain the file exists (Test-Path with PowerShell returns true).
Any idea what I'm doing wrong?
Update
Running the same command with mount type = volume gives me the following error:
C:/temp/prometheus.yml" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path"
I am passing an host directory and "C:/temp/prometheus.yml" is an absolute path.
You may run into this on Windows after you change your Windows account password.
Open Docker for Windows Settings.
On Shared Drives tab click Reset credentials...
Share your drive once again.
i got same error happened to me. as below picture, uncheck "Use Docker Compose V2" and it works for me. I wanted to share in case this might be the solution for somebody

Mounting ISO images with powershell inside windowsservercore fails

I am trying to perform an unattended install of SQL Server on Windows Server Core in Docker. But it throws this error: A virtual disk support provider for the specified file was not found.
Does anybody know how to make Mount-DiskImage work on Windows Server Core?
RUN #echo off && `
aws s3 cp s3://mybucket/en_sql_server_2016_developer_with_service_pack_1_x64_dvd_9548071.iso C:\en_sql_server_2016_developer_with_service_pack_1_x64_dvd_9548071.iso && `
for /f "delims=" %%A in ('#powershell -NoProfile -ExecutionPolicy Bypass -Command "(Mount-DiskImage -ImagePath C:\en_sql_server_2016_developer_with_service_pack_1_x64_dvd_9548071.iso -PassThru | Get-Volume).DriveLetter"') do set "ISO_DRIVE_LETTER=%%A" && `
echo Mounted SQL install image to drive %ISO_DRIVE_LETTER% && `
echo Setting up SQL Server.. && `
%ISO_DRIVE_LETTER%:\Setup /ConfigurationFile=SQLInstallConfig.ini
P.S.: I have tried to copy the ISO image directly onto the docker container and got the same result. So it doesn't seem to be a corrupted image.
As of August 2021 this is still not possible to mount disk images within a Windows Docker container. I've tried resolving this myself enough times, the furthest I've gotten is a vague mention of a "missing virtual DVD feature", though I can't find any features mentioning "virtual DVDs" or mentioning mounting images.
As a workaround, you can either extract the disk image/ISO to a folder or mount the image within the host. Then expose the directory path to the container.
Neither of these are perfect solutions when scripts or packages you don't maintain might attempt to download and mount a disk image/ISO as part of its own setup process. However, software installers or packages which do want a disk image as an external source oftentimes provide a parameter to specify an alternative installation source location so you may be able to find a suitable workaround in these scenarios.

Perl Network Drive Installation

I need to be able to run a few simple Perl scripts off of an NTFS (win server 2003 R2) drive. Is there any way to install Perl on this network drive (Strawberry or ActiveState, Strawberry preferred for built in cpan module compiler) and be able to run the scripts with whatever real time mounting on machines that do not have have/need a Perl distribution installed?
So far not having much luck with any relevant documentation.
Yes, we do this all the time.
Install Perl on your fileshare. I prefer to do this from the Windows Server hosting the fileshare, but I don't think it's necessary. If you don't have Remote Desktop and Admin access to that server, you'll need 2 PC's, 1 for the install and 1 to test this out. You can't test this on the same PC/server that ran the install.
Run this Windows Registry script on the test PC:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.pl]
#="Perl Script"
[HKEY_CLASSES_ROOT\Perl Script]
#="Perl Script"
[HKEY_CLASSES_ROOT\Perl Script\DefaultIcon]
#="C:\\WINDOWS\\system32\\Icons\\ActivePerl.ico,0"
[HKEY_CLASSES_ROOT\Perl Script\shell]
#="Open"
[HKEY_CLASSES_ROOT\Perl Script\shell\Open]
#="Open"
[HKEY_CLASSES_ROOT\Perl Script\shell\Open\command]
#="\"Z:\\network-folder\\Perl\\bin\\perl.exe\" \"%1\" %*"
[HKEY_CLASSES_ROOT\Perl Script\shellex]
[HKEY_CLASSES_ROOT\Perl Script\shellex\DropHandler]
#="{86C86720-42A0-1069-A2E8-08002B30309D}"
You will need to change this:
"C:\\WINDOWS\\system32\\Icons\\ActivePerl.ico,0"
to a path (preferably on the PC, not the network!) of an icon to go with the .PL files. You can drop those 2 lines from the reg script if you don't want a custom icon.
More importantly, you will need to change this:
"Z:\\network-folder\\Perl\\bin\\perl.exe\"
to the path where you installed Perl.
The DropHandler portion of that script is explained in more detailed in this other post: How do I create drag-and-drop Strawberry Perl programs?
Hope that helps!

How to use Volume Shadows Copy and Robocopy on Win7?

I’d like to backup my system with Robocopy and Powersell but Robocopy is not able to copy opened files.
Volume Shadows Copy seems a solution but I don’t find any clear and simple explanation how to use it.
Do you have any idea?
I’m running on Windows 7 x64 Enterprise.
Thanks for your help.
Franck
In order to perform a VSS snapshot on Windows 7, you can simply do a "System Restore". After, open an administrator console, type vssadmin list shadows. You are looking for the "Shadow Copy Volume" line in the most recent snapshot. Copy this, and do mountvol X: YOUR_VSS_PATH, and your VSS snap will be mounted on X:. After that, run robocopy on X: and you should be good to go.
You can mount the VSS shadow using mklink command. This Works in Servers and Workstations.
mklink is a native tool.
For example:
mklink /D C:\shadow_volume_1 \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\
More information can be found here: http://forensicswiki.org/wiki/Mount_shadow_volumes_on_disk_images

Unable to run PostgreSQL as Windows service

I had this in my Windows services:
C:/Program Files/PostgreSQL/8.4/bin/pg_ctl.exe runservice -N "postgresql-8.4" -D "D:/PostgreSQL/8.4/data" -w
It never finishes executing. But if I did this on the dos shell:
C:/Program Files/PostgreSQL/8.4/bin/pg_ctl.exe start -N "postgresql-8.4" -D "D:/PostgreSQL/8.4/data" -w
Notice that I only changed the "runservice" to "start" and it works just fine.
Any idea?
The command runservice can only be executed by the service manager
in order to fix my localhost windows 7 to start postgres as a service
i used the following command to start the data
pg_ctl -D "C:\Program Files\PostgreSQL\9.1\data" start
Then checked the status for errors
pg_ctl -D "C:\Program Files\PostgreSQL\9.1\data" status
if you get error 1063 , its more than likely permissions, i executed the following command
cacls "C:\Program Files\PostgreSQL\9.1\data" /E /T /C /G postgres:F
then reran the start/status, it showed everything fine, but still service manager would not start the service
So, in Services->postgresql->options->logon i set the log on as the Local system account instead of the postgres user, and voila it worked
this happened to me because i set my data directory to be somewhere the postgres windows user account didn't have access to.
I had this problem in Windows after a system crash. Running the first command showed invalid data in C:\Program Files\PostgreSQL\9.1\data\postmaster.pid. Deleting that file did the trick. Reference.
I faced the same issue after moving manually the database data files (PG_DATA directory) without recreating all the necessary permissions.
Here is how I solved my issue:
1. Check permissions on old PG_DATA directory:
cacls "c:\path\to\old\pgdata\dir"
2. Check permissions on new PG_DATA directory:
cacls "d:\path\to\NEW\pgdata\dir"
3. Compare outputs from 1. and 2.
Find the differences between users and/or permissions then synchronize them.
Nota: I found it easier to use explorer for the synchronization step rather than using cacls directly from the command line.
If you changed pg_hba.conf , maybe you missed somewhere in file. For example there must be CIDR after IP in that file. It must be like 192.168.1.100/32
If you forgot to put 32, then server doesnt restart.
Investigation of startup logs could be a clue. For the case problem is in the pg_hba.conf you could see something like this:
2018-11-13 00:39:34.841 PST [8284] FATAL: could not load pg_hba.conf
2018-11-13 00:39:34.842 PST [8284] LOG: database system is shut down
You need to check your logfiles and the windows eventlog for some hint of what the problem is. If there is nothing at all there, you need to break out something like Process Monitor and get a stacktrace of where it's hung.
I have had this issue in the past, and it was that the installer did not set up the permissions correctly for the user that the service was to run as.
I've also ran into this problem with postgresql throwing and error after trying to initialize the database cluster. After analyzing the log files and running command line scripts for 4 hours I've got the solution to anyone running into this problem for Windows Versions.
This is not a detailed description as to why its happening. I've installed odoo 10, 11, 12 and 13 numerous times on countless client servers and windows systems and this is the first time I've ever ran into this problem. I cant say if its because I have MS VS Enterprise installed and Android Studio on this machine or what. But Below is the easy answer on how to fix it and initialize the cluster and create the database files in the data folder.
Open the data folder for postgresql. - For Odoo installs it will normally be "C:\Program Files (x86)\Odoo 13.0\PostgreSQL" Unless you chose another location when installing.
Remove any or all files from this folder - If not you will get an error when running initdb.exe
Right click the data folder and open up the properties for it. Click on the Security tab and then click the advanced button on the bottom.
You need to change the owner of this folder to openpgsvc. Click Change and type in openpgsvc and click ok. Once done click the check box below saying that you want this change to affect containers with this container as well.
Then on the Permissions tab click the add button on the bottom. You need to add openpgsvc as a user and give this user full rights. Click apply and and ok to close out of all the folder properties.
Now you need to open cmd.exe - Once open we are going to call initdb.exe and pass some values to it as well.
First run chdir and change the working directory to the location of initdb.exe. For me, running odoo 13 on a windows 10 machine the location is this..
"C:\Program Files (x86)\Odoo 13.0\PostgreSQL\bin"
There is one variable that need to be passed as well to make this work here is the list. NEEDS TO BE INCLUDED IN THE CALL TO initdb.exe
Postgres Data Dir: "C:\Program Files (x86)\Odoo 13.0\PostgreSQL\data"
The End Result with the parameter would look like this for my installation:
"C:\Program Files (x86)\Odoo 13.0\PostgreSQL\bin\initdb.exe" -D "C:\Program Files (x86)\Odoo 13.0\PostgreSQL\data"
Hit Enter and let it rip. The output of this command should look like this below.
Cmd.exe running initdb.exe script
Make sure there is no buggy empty file Program at C:\ like C:\Program
In this case, explorer will warn whenever you log on into Windows.
File Name Warning
-----------------
There is a file or folder on your computer called "C:\Program" which
could cause certain applications to not function correctly. Renaming it
to "C:\Program1" would solve this problem. Would you like to rename
it now?
Installing PostgreSQL 10 On Windows 7 (yes the clock is ticking...). I first tried the latest version 11 which completely failed to install... not a good sign for Windows users. Anyway.
Quick answer: Change the account in the Windows Services panel from Network to Local.
Details of my case
During installation I created/selected a data folder in the user profile folder, because obviously the folder suggested by default, within the program folder, wouldn't work, and if it worked it would be a very idea to put data here (I don't know whether it's usual to do that on Unix/Linux, but for Windows it's it's not allowed for a long time).
At the end (when populating the data cluster) I received an error:
Failed to load SQL Modules into database Cluster
but the installation was able to complete. I found two pages about previous error, here and here, but they didn't seem relevant to my case, so I just started pgAdmin and, on the left "browser", saw the server wasn't active.
I tried to start it from here (had to type the main password), but it went inactive immediately again. So I tried to use the Windows services panel to start "postgresql-x64-10", no joy. I copied the command from this panel and pasted it into a Windows console (cmd.exe) where I finally received this
error 1063.
Searching I found this related question, and was convinced the problem was about permissions.
Solution working for my case
In the services panel I changed the account used to start the service from Network Service to Local System as suggested in a comment by #AlexanderRios.
sc create "postgresql-9.2" binPath= "\"C:/Program Files (x86)/PostgreSQL/9.2/bin/pg_ctl.exe\" runservice -N \"postgresql-9.2\" -D \"C:/Program Files (x86)/PostgreSQL/9.2/data\" -w" DisplayName= "postgresql-9.2" start= auto
Try this on CMD run as Administrator
(Add your parameters depend on your version)
Stop all postgres processes
Go to the postgres data folder (C:\Program Files\PostgreSQL\9.6\data)
Delete the postmaster.opts and postmaster.pid files
From the control panel, in administrative
tools and the services console start the postgres service
open pgAdmin III and then in right pane find server then just right click and connect, enter the password. after connected go to the browser and refresh ODOO. Problem solved.
See image to get better understanding