Win7's debug mode not work on VirtualBox's guest machine - serial-port

I install Win7 at my virtualbox, setup the guest end a standard "bcdedit"s. (debugtype=serial, port=1, baudrate=115200 /debug=on)
following steps took:
In the host end, I alloc a virtual serial port to the guest system
set the it with named-pipe "\.\pipe\debug".
I start Windbg to connect "\.\pipe\debug", I get "Could not open the pipe Win32 error 0n2"
After I power on the guest machine, I reopen Windbg, it works fine, but just saying "Opend \.\pipe\debug Waiting to reconnect...", It seems that no debugging data communicated with Guest Machine.
I try "bcdedit /bootdebug on", and reboot the machine. this time I see several output by Windbg during booting.
BD: Boot Debugger Initialized Connected to Windows Boot Debugger 7601
x64 target at (Sat Mar 17 17:28:46.559 2018 (UTC + 8:00)), ptr64 TRUE
Kernel Debugger connection established.
************* Path validation summary ************** Response Time (ms) Location Deferred
srvC:\Symbolshttp://msdl.microsoft.com/download/symbols Symbol
search path is:
srvC:\Symbolshttp://msdl.microsoft.com/download/symbols Executable
search path is: ReadVirtual() failed in GetXStateConfiguration()
first read attempt (error == 997. Windows Boot Debugger Kernel Version
7601 UP Free x64 Machine Name: Primary image base =
0x000000000052d000 Loaded module list = 0x00000000005df9e0 System
Uptime: not available Shutdown occurred at (Sat Mar 17 17:28:53.382
2018 (UTC + 8:00))...unloading all symbol tables.
It proves "\.\pipe\debug" is OK to transfer output of Guest VM's COM1.
When entering to login console, I see such message, and previous outputs turn to gray:
************* Path validation summary ************** Response Time (ms) Location Deferred
srvC:\Symbolshttp://msdl.microsoft.com/download/symbols Waiting to
reconnect...
I login and check the Device Manager, I can't find device COM1. but if I turn off /debug, I can.(Indeed, I used putty to check Guest'COM1 with Host's rawfile, I found it worked too, with the input of putty written to Host's file)
I tried many times with different COMs and baudrate, always got same outputs.
I tried a similar VMware Station, and got the same result.
Problem disappeared after I changed a Host machine and redid above steps.(:
Questions:
WHY can't I see the COM1 device with /debug on In the guest machine?
Does the Baudrate matters? (mismatch among Host's windbg setting, Guest's Device setting and Guest's debug setting), I tried to "Cycle BaudRate "In Windbg, it said Net COM port baud is ignored.
How to diagnose the problem?
_EDIT:
I found a similar post stuck on "reconnecting"
and this issue My Kernel Debugger Won’t Connect which refered there was a hot key "Ctrl+Alt+D" to show details of Windbg's I/O instead of a black-box. And it's normal and reasonable that COM1 disappear when "/debug=on" as the post said.
I could see the efforts windbg payed to sync the guest. After I pressed "ctrl+break", I saw windbg said "Send Sync", and still stuck... And, I would going to power off the guest by pressing "Host+Q". Miracle took place. Windbg came to alive and succeeded to break in.
I tried several times, with no failure. Now I can work happily... But WHY???
when I press "Ctrl+break", the windbg says
Send sync break
Send Break in ...
and stuck, and target machine is paused too. And I press "Host+Q" the "Esc" then it works.

install vbox in physical machine (the physical machine is Host henceforth)
install os inside vbox ( the os inside vbox is Target henceforth)
reboot Target and see if things go well a few times
open a elevated command prompt inside Target
since you have not created a Debug BootEntry create one first
run bcdedit /copy /? for syntax
to copy current bootentry to a new one you will be using
bcddedit /copy {current} /d "MyPipeDream"
{current} is alias for the current boot entry ID a GUID
MyPipeDream is a descriptive string
if you reboot now you should get two boot entries to choose from
choose the new bootentry to boot with so that you can operate with {current} well known ID instead of copy pasting or mistyping long unintuitive guids
assuming you booted MyPipeDream
you can check and enable debugging on the current id with
bcdedit /debug {current} on
you should reboot again to MyPipeDream which would be debug enabled now as in screen shots below
but before rebooting set the Serial Interface in vbox settings
also uncheck the connect to existing so that vbox creates the pipe
instead of trying to connect to an existing pipe
all setting on target are over now
on the host create a bat file with contents below and execute it
notice the pipename it is pipedream exactly matching the name we gave in vbox settings and not MyDreamPipe which is the ID descriptive string
start windbg -k com:port=\\.\pipe\pipedream,baud=115200,pipe,reconnect,resets=0
windbg should open up and say witing to reconnect
press ctrl+break a few times in the HOST WINDBG and vbox should connect to windbg or press ctrl+print screen in the TARGET
please see if you require Function keys (some wireless keyboards like logitech
needs ctrl+fn+pause / break key combos instead of plain ctrl+break
else open the Debug menu and select the Break in UI

Related

QGuiApplication pauses the event-loop when remote windows connection disconnected

I am starting a QGuiApplication (Qt 5.12) and using a remote desktop connection to a Windows 10 PC. Everything works fine while the remote desktop connection is open, but when I disconnect and let the application run during the week-end, I can see in the logs that it stops processing Qt events (mostly network related in my case). The last thing the logs show is an "activation change" event.
When I connect again after the weekend, the Qt event loop starts again (the logs show again "Activation Change event") and of course there is a huge amount of queued events and the application gets in a non responding state (I am logging the number of Qt events queue in the loop using qGlobalPostedEventsCount).
This used to work correctly but stopped working, I think due to an update of Windows on the machine (maybe same root-cause than this thread ?).
Is this the expected behavior for applications when the windows remote connection is terminated? Is there a known fix for this?
I have not managed to properly fix the issue. As a work-around, using Microsoft "Remote Desktop" application instead of using the "Remote Desktop Connection" application avoids the issue.

ProtonVPN broke my machine after upgrade to Linux CLI version 3

I'm using the ProtonVPN Linux CLI client Ubuntu 18.04.
I was previously using the 2.2.6 version, but I wanted to upgrade, which was a huge mistake.
I uninstalled v2.2.6 and followed the instructions for installing v3.7.1 on the ProtonVPN website.
After installation, I was able to create a connection, use the Internet, etc. Everything seemed to work. I enabled the killswitch permanently with $ protonvpn-cli ks --permanent.
Then, I closed my laptop lid. When I re-opened it, I had no Internet connection. I expected this, since that's how the 2.2.6 client worked, and I'm used to having to manually reconnect every time I open my laptop.
I attempted to reconnect to the VPN, but it didn't work the way I expected. $ protonvpn-cli r wouldn't find previous connection data, and $ protonvpn-cli c returned the error
Setting up ProtonVPN
An unknown error has occured. Please ensure that you have internet connectivity.
If the issue persists, please contact support
My wifi connection was fine. If connectivity is the issue, then I assume it must be the killswitch. I disabled the killswitch with $ protonvpn-cli ks --off. My first question is, under v.2.2.6 I did not have to disable the killswitch in order to connect to ProtonVPN itself. Is this changed in v3.7.1?
With the killswitch disabled, $ protonvpn-cli r continues to not find previous connection data, but $ protonvpn-cli c at least makes an attempt at working. However, it's still broken. It takes a minute to load the list of countries. When I select "United States", it seems to freeze while loading the list of servers. I've tried several times, and I've reconnected my wifi. It just won't load servers.
My device now lacks internet connectivity entirely. I've turned off the killswitch, I've closed the terminal I was running protonvpn-cli in, and there are no protonvpn processes active on the machine. The wifi is fine, and other devices are using it to connect to the Internet perfectly well. I've even rebooted the laptop, but it still won't connect to the internet. ProtonVPN has completely wrecked it.
Please help me.
Although I don't think the problem still persists on your side I've struggled with similar problem today. For me the solution found here https://askubuntu.com/questions/1319033/internet-stops-working-after-installing-protonvpn solved all connectivity issues, by simply removing the pvpn-ipv6leak-protection as following:
sudo nmcli connection delete pvpn-ipv6leak-protection
This is from proton's own old web page on how to remove the leftover "always on kill switch" uning command lines in the terminal. It is on the page: "How to install early-access Proton VPN Linux CLI"
located # https://protonvpn.com/support/linux-vpn-tool-early-access/
Disable the kill switch if you have uninstalled the app
The kill switch can be easily disabled from within the official Linux CLI app, but this will not be possible if you have uninstalled the CLI app first without disabling the kill switch. This may result in your system being unable to access the internet. To remove the kill switch after the CLI app has been uninstalled:
a) Identify Proton VPN connection names by running the command:
nmcli connection show --active
This will display a list of all your system’s active connections.
b) Look for any connections with the pvpn- prefix. This usually includes pvpn-killswitch and pvpn-ipv6leak-protection, and may include pvpn-routed-killswitch. Delete all these connections using the following command:
nmcli connection delete [connection name]
For example:
nmcli connection delete pvpn-killswitch
c) Re-run the following command to verify that Proton VPN connections have been deleted:
nmcli connection show --active
If any Proton VPN connections remain, delete them as described above.
Don't know enough about linux to be helpful but have run into the same issue.
Seems to be that proton stuffs with the resolv.conf file.
This link has a fix https://www.reddit.com/r/Ubuntu/comments/cpzaxo/remove_protonvpn_from_ubuntu/
But I can't get it to work as chattr will not allow me to remove the -i permissions.
chattr: Inappropriate ioctl for device while reading flags
Maybe it will work for you

R studio server browser freezes upon login

I have been working on my R studio session hosted by a Linux server and recently, ran a piece of code that was taking way too long to execute and I decided to kill it.
Here is the sequence of steps that I took - none of them helped me restore the health of my session.
1) Hit the stop button on R studio and be patient.
2) Ssh into my Linux server and ran the following command to kill all the processes running with my userid
killall -u myuserid
3) Removed the.RData,.Renviron,.Rhistory files from my workspace.
4) Ran the following R command via the Linux server for garbage collection
gc(reset=TRUE)
4) Restarted the entire Linux server.
I am running out of ideas and would really appreciate any other suggestions before I take more drastic steps like revoking access and granting it again(not sure if that would be the right fix)
Note: The browser window freezes every time I login, and it happens only for my R studio session, the rest of the users in the same network have no issues.
I solved this problem - Rstudio-serverfreezing. I think it was a network problem since I couldn't receive any response from calling "~~~~~~.cache.js". In this case, you can find out "~~~~~~~~~.cache.js" no response with pushing key before you click log-in button.
Anyway, here is my way.
Reset your Network with following orders
you can insert these into cmd terminal as an admin mode.
netsh winsock reset
netsh int ip reset
Reboot
The IP information may be erased. So if you're using fixed IP address, fill the blanks with as-is IP address.
That's all.
You may follow this way to recover the connection.

raspbian : execute a command each time ttyUSB0 comes up

I have a raspbian with an USB connection to an arduino (/dev/ttyUSB0).
I would like, each times I replug (after unplug it), to run command, but I have no idea how to do this.
Reset the speed configuration and restart the program that use it.
Does someone known what to do ?
Ports are in any Linux represented as files. So you can make script in any language which in loop will be checking if the file with specific name exists (The name of port you looking for). If the file is detected than you can execute what you want.

Error: "job pending on /dev/sda1" when plugging in USB device

On my raspberry pi running raspbian (unix based i think) I get this error "job pending on /dev/sda1" every time that i plug in my USB flash drive. from my research it has something to do with mounting and un-mounting the device but I'm new to command line and most other posts are over my head. What do i do to fix this error?
if it matters i'm running a script on the pi that writes to that flash drive
Your desktop (LXDE for Raspberry Pi) has spotted that you have inserted a USB disc and has tried to mount it. You can enable or disable this behavior by editing the file ~/.config/pcmanfm/LXDE-pi/pcmanfm.conf and changing the line
mount_removable=1
to set '0' instead.
You would get that error if there were more than one thing trying to mount your USB disc at the same time. The second to run will notice that the first has already started a job to mount the disc.
Are you running two copies of your desktop GUI? (You may not realize that you are, but if you have a VNC or XRDP service you probably will be.)
If that is the cause of your problem (and probably in any event) the message is harmless. Something will have mounted your USB disc (perhaps you can even see it in /media?) The only infelicity will be that your desktop won't show you the results (e.g. by displaying the drive in a file manager.)

Resources