Virtual Inertia Control (VIC) provides simultaneous inertia and damping to grid-connected to enhancing system inertia and damping, keeping the stability of system frequency during Renewable Energy Source (RES) penetration. VIC consist of an Energy Storage System (ESS), inverter, and inertia control technique. This paper uses retired EV battery due to it is potential as a power source for VI, which it can be used as an ancillary service to grid (i.e., frequency regulation), such as to smoothing the output power of RES that caused by it is intermittent characteristic. VIC parameters need to be optimized to get better frequency response. In the current trend, the metaheuristic algorithm is widely used for optimizing VIC parameters. This paper implemented Firefly Algorithm (FA) for optimizing VIC parameters. The results of this paper have been conducted in two secnarios. The simulation result after 10 running simulations with 100 iterations are the standard deviation for FA is 50 percent smaller than PSO for scebario 1 and and 20.8 percent smaller than PSO for scenario 2. Moreover, FA also has a 92 percent faster running time than PSO for scenario 1, and 93 percent faster running time than PSO for scenario 2. From the optimization result, in scenario 1, FA for the VIC parameters optimization is more effective in reducing frequency oscillations and results in 21.5 percent faster settling time but in exchange will make 3 percent greater overshoot and undershoot frequencies than optimizing VIC based on PSO parameters. In scenario 2, due to optimization VIC parameters obtained by FA and PSO have similar results and it makes the frequensy response are also similar.