Pages

How to Reset a Linux Guest Password in Proxmox (via QEMU Guest Agent)

Today I faced a simple but tricky task: logging into a Ubuntu Server without knowing the password. Easy? Usually yes, but not when you're locked out.

Fortunately, the VM was running on Proxmox with the QEMU Guest Agent installed and enabled. This makes resetting the credentials a breeze, as it allows the host to communicate directly with the guest OS.

Here is the quick workflow:


First, log into your Proxmox shell (via SSH or the web console) and list all running VMs to find the correct ID:

root@proxmox:~# qm list


Once you have the VM ID (e.g., 101) and the username (e.g., root or ubuntu), run the following command:

root@proxmox:~# qm guest passwd <VM_ID> <username>


Proxmox will prompt you to enter the new password twice. After that I was able to log into the Ubuntu Server!


That's all!

How to open/close port on Windows Server firewall

To open port on Windows Server firewall I am using this command:

netsh advfirewall firewall add rule name="My rule name port 12345" dir=in action=allow protocol=TCP localport=12345


For port close the command is like that:

netsh advfirewall firewall delete rule name="My rule name port 12345"


That's all.

Link to Microsoft article is here.


Enable CDC for database and table

To enable CDC for database and table in that DB just do this:

USE [DatabaseName]
GO
EXEC sp_changedbowner 'sa'
GO
EXEC sys.sp_cdc_enable_db
GO

EXEC sys.sp_cdc_enable_table
    @source_schema = N'dbo',
    @source_name   = N'TableName',
    @role_name     = NULL,
    @supports_net_changes = 1
GO

That's all :)

Comarch Optima 2026.2.1 - problemy przy instalacji/aktualizacji

 Ostatnio duży było zamieszania nt. instalacji/aktualizacji Comarch Optimy do najnowszej wersji 2026.2.1.

Ja również miałem ten problem, który po aktualizacji zaczął objawiać się tym, że Optima nie widziała kluczy, tylko szukała ich w modelu subskrybcyjnym, nie można było zmienić firmy itd.

Rozwiązaniem (podobno) było przeklikanie dowolnego modułu i wtedy można było się zalogować...

U mnie problemem było to, że jedna - nieużywana baza/firma wskazywała na nie istniejący już klucz w konfiguracji: 
Konfiguracja > Firma > Ogólne > Parametry i Dedykowany serwer klucza.

Po ujednoliceniu Optima instaluje się bez problemów.

Map network share via script

 To map network share via batch script I am using this simple script


set DRIVE_LETTER=<drive-letter>
set SERVER_NAME=<your-server-name>
set SHARE_NAME=<share-name>
set DOMAIN_NAME=<domain-name>

net use %DRIVE_LETTER%: /delete /yes
net use %DRIVE_LETTER%: \\%SERVER_NAME%\%SHARE_NAME% /user:%DOMAIN_NAME%\%USERNAME% /persistent:yes


Where:

DRIVE_LETTER - the letter under which would be the network share mapped, i.e. W:

SERVER_NAME - it could be IP address or local server name (if DNS is properly setup), i.e. server.example.local

SHARE_NAME - name of the network share that we want to map, i.e. documents

DOMAIN_NAME - your local domain name (Active Direcotory or Linux Samba AD), i.e EXAMPLE

%USERNAME% - used in a script gets current username, i.e jdoe