public static string RunCommand(string cmd, string vmName, string oem = "bgp")
        {
            int length = -1;

            if (cmd != null)
            {
                length = cmd.IndexOf(' ');
            }
            string path;
            string str;

            if (length == -1)
            {
                path = cmd;
                str  = "";
            }
            else
            {
                path = cmd?.Substring(0, length);
                str  = cmd?.Substring(length + 1);
            }
            Logger.Info("Will send command: {0} to {1}", (object)str, (object)path);
            Dictionary <string, string> data = new Dictionary <string, string>()
            {
                {
                    "arg",
                    str
                }
            };

            return(VmCmdHandler.SendRequest(path, data, vmName, out JObject _, oem));
        }
        public static void SyncConfig(string keyMapParserVersion, string vmName)
        {
            VmCmdHandler.RunCommand("settime " + ((DateTime.UtcNow.Ticks - 621355968000000000L) / 10000L).ToString(), vmName, "bgp");
            Utils.SetTimeZoneInGuest(vmName);
            Dictionary <string, string> data = new Dictionary <string, string>();
            string currentKeyboardLayout     = Utils.GetCurrentKeyboardLayout();

            data.Add("keyboardlayout", currentKeyboardLayout);
            string path = "setkeyboardlayout";

            Logger.Info("Sending request for " + path + " with data : ");
            foreach (KeyValuePair <string, string> keyValuePair in data)
            {
                Logger.Info("key : " + keyValuePair.Key + " value : " + keyValuePair.Value);
            }
            string str = VmCmdHandler.SendRequest(path, data, vmName, out JObject _, "bgp");

            if (str == null || str.Contains("error"))
            {
                Logger.Info("Failed to set keyboard layout in sync config...checking for latinime");
                try
                {
                    if (Utils.IsLatinImeSelected(vmName))
                    {
                        HTTPUtils.SendRequestToEngine("setPcImeWorkflow", (Dictionary <string, string>)null, vmName, 0, (Dictionary <string, string>)null, false, 1, 0, "", "bgp");
                    }
                    else if (Oem.Instance.IsSendGameManagerRequest)
                    {
                        HTTPUtils.SendRequestToClient("showIMESwitchPrompt", (Dictionary <string, string>)null, vmName, 0, (Dictionary <string, string>)null, false, 1, 0, "bgp");
                    }
                }
                catch (Exception ex)
                {
                    Logger.Warning("Error in informing engine/client. Ex: " + ex.Message);
                }
            }
            if (VmCmdHandler.RunCommand("setkeymappingparserversion " + keyMapParserVersion, vmName, "bgp") == null)
            {
                Logger.Error("setkeymappingparserversion did not work, will try again on frontend restart");
            }
            else
            {
                RegistryManager.Instance.Guest[vmName].ConfigSynced = 1;
            }
        }