How to run Windows' chkdsk from a remote virtual machine on Linux?

2

1

I need to remotely run Windows' "chkdsk" utility (in order to fix a corrupted external NTFS drive) on someones else Linux/Debian computer over ssh. What is the best lightweight way to do this? Microsoft offers free virtual machines - VirtualBox and Vagrant with Windows. Which one would you recommend for the following scenario?

  1. I have to install the VM on the remote machine,
  2. then ssh to it,
  3. launch VM there sharing the external hard drive to be checked by "chkdsk" with the VM,
  4. enter the VM somehow (I prefer to do everything in text mode, without forwarding Xserver over ssh - is it possible at all?)
  5. run "chkdsk".

Do you have a better idea to accomplish this task? I'm not aware but maybe there is an image of some sort of CLI Windows Recovery Suit with just a couple of basic tools (including "chkdsk"), so I don't have to load whole Windows into VM?

user1876484

Posted 2018-02-14T21:30:05.090

Reputation: 123

1

"I need to remotely run Windows' "chkdsk" utility on someones else Linux/Debian computer over ssh." Why? This seems like an XY problem

– DavidPostill – 2018-02-14T21:40:43.960

Because people on the other end are not so tech savvy and all they can do is to attach the failing hard drive to the USB port. I have to do the rest. Linux was installed there by me. – user1876484 – 2018-02-14T21:46:39.060

It's also not a one time situation. It's going to happen from time to time, so I'm looking for a long term solution. – user1876484 – 2018-02-14T21:49:43.223

1Why are you going to run a Windows utility on a Linux OS? Running the tool from a VM will NOT scan the physical hardware, running chkdsk from within a VM, would scan the virtual HDD which is sort of pointless. Linux has it's own check disk utility you should be using that. "Which one would you recommend for the following scenario?" - They are identical, also, recommendations of this type are going to be highly opinionated. – Ramhound – 2018-02-14T22:00:08.693

2@Ramhound As far as I know, you cannot fully fix faulty NTFS in Linux in general. There is ntfsfix but its manual explicitly states it's not a Linux version of chkdsk, it repairs some fundamental inconsistencies only. If the VM with Windows captures the USB the drive is connected to, it should be able to run chkdsk on the physical hardware. The OP's explanation about "people on the other end" makes me think this approach is at least justified. – Kamil Maciorowski – 2018-02-14T22:20:58.657

The drive isn't external it's remote. A VM is not a realistic solution, as in, it cannot be used at all. The VM will be unable to run chkdsk, which can only scan local drives connected directly to the VM, besides the fact there is no indication NTFS is even used considering the use of Debian – Ramhound – 2018-02-14T22:29:37.873

2

The question does make sense. What I understand OP wants to do is run a windows VM on the remote Debian system, attach the USB disk to it (ie: map the /dev/sdX block device as a disk in the windows VM) and then use a windows tool to scan the "disk". With hardware failures, this will also depend on the disk emulation layer (of virtualbox) ability to cope and transfer error codes to VM, all bets are off. step 4: it depends on what windows can do. maybe https://superuser.com/questions/1223865/linux-connect-from-host-to-virtualbox-guest-over-virtual-serial-port ? can windows do serial console?

– A.B – 2018-02-15T07:06:35.483

@Ramhound - the disk is both external and remote, - it is an NTFS external hard drive attached to the remote Linux machine. Everything exactly as A.B has described. – user1876484 – 2018-02-15T07:57:25.433

No answers