@SneakyThrows
    public void saveRecordingToFile(@NonNull File file) {
        try (InputStream inputStream = streamRecording()) {
            Files.copy(inputStream, file.toPath(), StandardCopyOption.REPLACE_EXISTING);
        }
    }
Create a sidekick container and attach it to another container. The VNC output of that container will be recorded.
core/src/main/java/org/testcontainers/containers/VncRecordingContainer.java