Why my Windows10 host can't connect the virtual machine(Centos 7) running on another ubuntu host(20.04)?
Basic information :The virtual machine running on the ubuntu host had set the static IP and the Internet connection is available. The sshd.servicre is also running,the firewalld is disable. Moreover,the virtual machine can ping the ubuntu host and the ubuntu host can ping the virtual machine. Further,my windows10 host can also ping the ubuntu host. However, my windows10 host can't ping the virtual machine and can't connect the virtual machine.
My question is how to solve this confusing question?
do you know?
how many words do you know
See also questions close to this topic
-
WebView2 JS injection returns empty json string
With WebView2 for targeting Windows, I am trying to setup my own context menu. Either by selected text or by underlying element pointed by mouse click.
However, I can't get DOM element by mouse operation or even by byId. I think my JavaScript injection or WebView property setting is something wrong, but not too sure. Can anyone suggest me the resolution?
The version info.
- OS : Windows 10 Pro 21H2 19044.1682
- Visual Studio : Community 2022 17.1.6
- WebView2 : 1.0.1185.39
- Project Property: Target framework=.NET 6.0; Target OS version=10.0.19041.0
Here's the testing code
using Microsoft.Web.WebView2.Core; namespace WinFormsApp1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); HTML(@"C:\temp\test.html"); } public void HTML(string url) { webView21.CoreWebView2InitializationCompleted += WebView2Control_CoreWebView2InitializationCompleted; webView21.Source = new Uri(url); } private void WebView2Control_CoreWebView2InitializationCompleted(object? sender, CoreWebView2InitializationCompletedEventArgs e) { if (!e.IsSuccess) { MessageBox.Show($"WebView2 creation failed, with exception : {e.InitializationException}"); return; } // subscribe to events we are interested in webView21.CoreWebView2.ContextMenuRequested += CoreWebView2_ContextMenuRequested; // user clicked right mouse to show context menu } private async void CoreWebView2_ContextMenuRequested(object? sender, Microsoft.Web.WebView2.Core.CoreWebView2ContextMenuRequestedEventArgs e) { IList<CoreWebView2ContextMenuItem> menuItemList = e.MenuItems; menuItemList.Clear(); // clear default menu items, like prev, next, property //GETTING SELECTED TEXT string text = e.ContextMenuTarget.HasSelection ? e.ContextMenuTarget.SelectionText : ""; // it works if (string.IsNullOrEmpty(text)) // no text selection, then examine DOM { //GET AN UNDERLYING ELEMENT FROM MOUSE POINT var result = await webView21.CoreWebView2.ExecuteScriptAsync($"document.elementFromPoint({e.Location.X},{e.Location.Y})"); //it doesn't work, just returns an empty JSON text (not null) //var result = await webView21.CoreWebView2.ExecuteScriptAsync("function foo(){return 'foo() gets called';}; foo();"); //for testing purpose, it works //var result = await webView21.CoreWebView2.ExecuteScriptAsync("function foo(){return document.getElementById('table-content'};foo();)"); //it returns an empty result } // TO DO // setup menuItem tree based on the result we got //...... //...... e.Handled = true; } } }
-
site only opens in CefSharp
zaakr.net is a site can be opened only in zaakr.exe application or through android(.apk), when opened in browser u been redirected to https://browser.zaakr.net so u download there application, (.exe) file is using cefsharp as a browser so it can access website, from 2 month i could open it from chromium as cefsharp uses chromium, now i can't access website through chromium for some reason idk, i even made a cefsharp browser myself using visual studio nothing worked all the time i been redirected to browser.zaakr.com, i want to access through any browser that have devtools available for a project, note that application zaakr.exe is still using cefsharp even the older version still can access site. i would appreciate any help, sry for any spelling mistakes, thanks.
-
Subprocess $Env:Path python: The filename, directory name, or volume label syntax is incorrect
I am trying to change the windows environment variables, but I am having trouble doing so.
Before I tried to use
os.environ()
I tried out using powershell commands and adding a string to$Env:Path
which worked, but removing it with:$env:Path = ($env:Path.Split(';') | Where-Object -FilterScript {$_ -ne $Remove}) -join ';'
however didn't seem to remove it being my path I want to add
("FFmpeg:C:\Users\user\AppData\"
) and adding it with+= C:/Users/etc..
didn't see, the way to go.Another way I tried to add vars through the Powershell commands was using
SetEnviormentVariable
and it seemed to work fine but once I restarted my PC the entry I made with it was gone.Sadly though all in the end all my powershell commands didn't work with subprocess. Whatever command it was I was using here I got:
PS C:\Users\Me123> python >>> import subprocess >>> subprocess.run("$Env:Path", shell=True) The filename, directory name, or volume label syntax is incorrect. CompletedProcess(args='$Env:Path', returncode=1)
-
Getting mongo authorization errors with userAdminAnyDatabase role
I am trying to get authorization working on a mongo database on a new Ubuntu machine. I have created an admin user with the role userAdminAnyDatabase:
admin> show users [ { _id: 'admin.mongoAdmin', userId: UUID("590a4465-625a-4fa0-af2e-0f2c75777ac5"), user: 'mongoAdmin', db: 'admin', roles: [ { role: 'userAdminAnyDatabase', db: 'admin' } ], mechanisms: [ 'SCRAM-SHA-1', 'SCRAM-SHA-256' ] } ]
but I get authorization errors when I try to do anything:
admin> use test switched to db test test> db.users.find({}) MongoServerError: not authorized on test to execute command { find: "users", filter: {}, lsid: { id: UUID("f3cf2fbc-bbea-4ceb-83a1-b842b5047e74") }, $db: "test" }
I know I am using the correct id/password, as when I try to run the mongo shell with a different password it fails to start with a password error.
Ubuntu version is 20.04.4 (Focal); Mongo version is 5.0.8:
% mongod --version db version v5.0.8 Build Info: { "version": "5.0.8", "gitVersion": "c87e1c23421bf79614baf500fda6622bd90f674e", "openSSLVersion": "OpenSSL 1.1.1f 31 Mar 2020", "modules": [], "allocator": "tcmalloc", "environment": { "distmod": "ubuntu2004", "distarch": "x86_64", "target_arch": "x86_64" } }
-
docker discord.py ffmpeg.exe was not found
My code works on windows fine I'm just stumped on how to migrate it to my docker server for stability reasons and my old vm shit the bed. bellow is my main playing loop
async def main_playing_loop(vc, ctx): global skip while len(queued[str(ctx.guild.id)]) > 0: try: print(vc.is_playing()) while vc.is_playing() or vc.is_paused(): await asyncio.sleep(2) skip_func(vc) pass except AttributeError: pass try: url = str(queued[str(ctx.guild.id)][0]) download_video(ctx, url) vc.play(discord.FFmpegPCMAudio(executable="ffmpeg.exe", source=str(ctx.guild.id) + ".mp3")) del queued[str(ctx.guild.id)][0] except: break
log of what its doing
discord_main_1 | [youtube] dQw4w9WgXcQ: Downloading android player API JSON discord_main_1 | [youtube] dQw4w9WgXcQ: Downloading webpage discord_main_1 | stoping discord_main_1 | [youtube] dQw4w9WgXcQ: Downloading android player API JSON discord_main_1 | [info] dQw4w9WgXcQ: Downloading 1 format(s): 251 discord_main_1 | [download] Destination: 866270239342460930.mp3 [download] 100% of 3.28MiB in 00:00 discord_main_1 | Ignoring exception in command play: discord_main_1 | Traceback (most recent call last): discord_main_1 | File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 85, in wrapped discord_main_1 | ret = await coro(*args, **kwargs) discord_main_1 | File "/usr/src/bot/main.py", line 125, in play discord_main_1 | vc.play(discord.FFmpegPCMAudio(executable="ffmpeg.exe", source=str(ctx.guild.id) + ".mp3")) discord_main_1 | File "/usr/local/lib/python3.10/site-packages/discord/player.py", line 225, in __init__ discord_main_1 | super().__init__(source, executable=executable, args=args, **subprocess_kwargs) discord_main_1 | File "/usr/local/lib/python3.10/site-packages/discord/player.py", line 138, in __init__ discord_main_1 | self._process = self._spawn_process(args, **kwargs) discord_main_1 | File "/usr/local/lib/python3.10/site-packages/discord/player.py", line 147, in _spawn_process discord_main_1 | raise ClientException(executable + ' was not found.') from None discord_main_1 | discord.errors.ClientException: ffmpeg.exe was not found. discord_main_1 | discord_main_1 | The above exception was the direct cause of the following exception: discord_main_1 | discord_main_1 | Traceback (most recent call last): discord_main_1 | File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 939, in invoke discord_main_1 | await ctx.command.invoke(ctx) discord_main_1 | File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 863, in invoke discord_main_1 | await injected(*ctx.args, **ctx.kwargs) discord_main_1 | File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 94, in wrapped discord_main_1 | raise CommandInvokeError(exc) from exc discord_main_1 | discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: ffmpeg.exe was not found.
i have still got the old exe for ffmpeg i was using on win but that doesn't work on Ubuntu. any help is appreciated thanks.
-
Linux on Lightsail instance is asking for a password and it's not working
I'm trying to restart
mariaDB
on Ubuntu but it's not letting me.I enter:
systemctl restart mariadb
and get:
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units === Authentication is required to restart 'mariadb.service'. Authenticating as: Ubuntu (ubuntu) Password: polkit-agent-helper-1: pam_authenticate failed: Authentication failure ==== AUTHENTICATION FAILED ===
I have the same password for all functions so I do not understand why it is not working. What can I do?
-
Software connected to LAN on XP, but not on Windows 10
I recently upgraded my operating system from windows XP SP3 to windows 10pro.
The problem is that I have a software that worked perfectly under XP, but which, once installed on Windows 10, cannot exchange data with other devices on the LAN network.
With the same network configurations as under XP, the software does not even connect to the LAN network.
However, the ping towards all the IP addresses of the network shows that everything is fine. But still, the software is not connected.
On other forums I have been told about certain security updates under windows 10 which could be the cause of this communication failure.
Is that the case ? If so, what would be the best solution to my problem please?
-
What does this number mean in the output of a dig command?
$ dig @8.8.8.8 medium.com a ; <<>> DiG 9.16.15-Debian <<>> @8.8.8.8 medium.com a ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64434 ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION SECTION: ;medium.com. IN A ;; ANSWER SECTION: medium.com. 300 IN A 162.159.152.4 medium.com. 300 IN A 162.159.153.4 ;; Query time: 32 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Fri May 06 21:34:45 EDT 2022 ;; MSG SIZE rcvd: 71
What does the number
300
mean inANSWER SECTION
? Is it the ranking of the records? Can't find anything online explaining it. -
Virt-manager filesystem passthrough not working
I'm new to the ubuntu/linux environment so I don't have a lot of knowledge before hand.
I'm currently trying to set up a filesystem passthrough between my host (Ubuntu 22.04 LTS) and my vm (Ubuntu 16.04 LTS). I tried setting it up by following a youtube link but when i tried to add a file to it the other party can not open the file (i.e when i add a text document from my vm, the host cannot open the file). how the filesystem passthrough is currently showing
This is the filesystem code that I am running on my vm:
<filesystem type="mount" accessmode="mapped"> <source dir="/home/kkuma30/VIRTUAL_BOX"/> <target dir="/hostshare"/> <address type="pci" domain="0x0000" bus="0x00" slot="0x09" function="0x0"/> </filesystem>
One thing to note is in my virtual machine manager, there is no way to choose how to the type or mode in the filesystem passthrough. filesystem passthrough setting
Is there anyway to fix this? I am trying to emulate Ubuntu 16.04 to run FVCOM
-
VirtualBox Error NEM failed to map page(s) into the VM. (VERR_NEM_MAP_PAGES_FAILED)
Im getting this issue for the first time, im not sure how to fix it. Running Windows 10 Home, Virtualization enabled. My VM is Parrot OS
Complete error:
Failed to open a session for the virtual machine Parrot.
NEM failed to map page(s) into the VM. (VERR_NEM_MAP_PAGES_FAILED).
Result Code: E_FAIL (0x80004005) Component: ConsoleWrap Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
I have no idea how to fix this and I cant find anything about it online.
-
Reload sshd configuration in container without restarting the container
I would like to deploy an ssh bastion jumper as a deployment in a Kubernetes cluster. This should receive its sshd_config as well as the authorized_keys via a ConfigMap or Secret. These can of course change over time, so that a reload of the sshd service becomes necessary.
How can I automate this process? Existing ssh connections should not be killed when updating the config or authorized_keys file.
My dockerfile is:
FROM docker.io/alpine:latest RUN apk add --no-cache openssh-server EXPOSE 22/tcp CMD ["/usr/sbin/sshd", "-D", "-e"]
My deployment looks like:
apiVersion: apps/v1 kind: Deployment metadata: name: sshd-server namespace: sshd spec: replicas: 2 template: metadata: labels: app: sshd-server spec: containers: - name: my-sshd-server image: my-sshd-server-image:latest imagePullPolicy: Always ports: - containerPort: 22 volumeMounts: - mountPath: /etc/ssh/sshd_config name: sshd_config - mountPath: /user/.ssh/authorized_keys name: authorized_keys ...
-
SSHD config: PermitUserEnvironment on a case-by-case basis
I have a git server where people set up remote repositories over ssh, and there's a git user that they all connect as which has secure permissions and whatnot.
I'm editing the pre-receive hook in a repo so that it sees if the environment variable,
$GIT_USER
, matches the list of allowed users for that repo to prevent unauthorized users from pushing.This environment variable is set individually in the git user's
.ssh/authorized_keys
file.However, I don't want environment variables to be set for ssh for any user besides git.
Is there any way to edit
/etc/ssh/sshd_config
such thatPermitUserEnvironment
is only enabled for the git user? -
Can you get the remote IP during SSH AuthorizedKeysCommand execution?
Is it possible to get the incoming IP address of an SSH connection before the connection is authorized?
We're using an AuthorizedKeysCommand bash script that is working as intended, but I would like to be able to at least log attempts including the incoming IP address. I've been unable to find anything that would even vaguely hint that it's available. Environment variables like
$SSH_CLIENT
and$SSH_CONNECTION
are empty in the script, and there are no tokens available in the sshd config that contain IP.The authorized keys script is pretty simple.
#!/bin/bash curl -sf -X GET "http://10.x.x.x/gatekeeper/$1/$IP_WOULD_GO_HERE"